1

I am trying to use the Github Oauth API for a specific purpose:

Github OAuth API Specs

Here is what I did:

I created an "Application" in my Github account, and added an application URL say http://example.com/ and a Callback URL http://example.com//. Github, in return, generated a client_id and client_secret.

I used the client_id to generate an authorization url:

https://github.com/login/oauth/authorize?client_id=<client_id>&scope=repo&redirect_url=http://example.com/auth/

When I paste this URL in the browser. Github asks me sign-in. Once I sign in with my credentials, it asks me to authorize the application, which I do. However, it returns to this url with a temporary code:

 http://example.com/?code=<temporary code>

, instead of the redirect_url that I had provided:

   http://example.com/auth/?code=<temporary code>

In general, I want the flexibility to construct my own redirect_url, where I can add few parameters to the redirect_url so that I can distinguish between different users.

I'v tried different combinations without any success. I've even tried to encode the redirect_url parameter but it does not work.

1 Answer 1

3

The name of the parameter is not redirect_url, it is redirect_uri (URL -> URI).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.