Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github oauth multiple authorization callback URL

Tags:

I want to work in my localhost and my live domain, there is any way to insert more then one callback to github oauth settings? How we solve this problem?

Redirect URLs

like image 354
Bazinga Avatar asked Mar 11 '16 13:03

Bazinga


People also ask

What is GitHub authorization callback URL?

In "Callback URL", type the full URL to redirect to after a user authorizes the installation. This URL is used if your app needs to identify and authorize user-to-server requests.

What is a callback URL in OAuth?

A callback URL is the URL that is invoked after OAuth authorization for the consumer (connected app). In some contexts, the URL must be a real URL that the client's web browser is redirected to.

What is callback URL in authentication?

Callback URLs are the URLs that Auth0 invokes after the authentication process. Auth0 redirects back to this URL and appends additional parameters to it, including an access code which will be exchanged for an id_token , access_token and refresh_token .


1 Answers

I solved this issue by creating a dedicated OAuth application on Github for my local development environment. So I have the following 2 OAuth applications:

  1. My official OAuth application for production

    • Client ID: ABC
    • Client Secret: 123
    • Authorization callback URL: https://example.com/api/v1/security/oauth/github/callback
  2. My private OAuth application for development

    • Client ID: XYZ
    • Client Secret: 456
    • Authorization callback URL: https://localhost/api/v1/security/oauth/github/callback

When I configure my API in local, I use the ID and secret of the development application (2). And in production I use the ID and secret of my official application (1).

like image 118
Alexis.Rolland Avatar answered Sep 22 '22 02:09

Alexis.Rolland