Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send same redirect_uri as /authorize to /token #341

Merged
merged 2 commits into from
Jan 28, 2020

Conversation

stevehobbsdev
Copy link
Contributor

@stevehobbsdev stevehobbsdev commented Jan 27, 2020

Description

This PR ensures that the same redirect_uri value is sent to the /token endpoint as was sent to the /authorize endpoint.

In the case of loginWithRedirect, the redirect URI is stored in the transaction store and then used in handleRedirectCallback.

References

Fixes #287

Testing

This has been tested manually in the Vue quickstart that has been modified to accept a different callback URL from the base app URL.

  • This change adds test coverage for new/changed/fixed functionality

Checklist

  • I have added documentation for new/changed functionality in this PR or in auth0.com/docs
  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

@stevehobbsdev stevehobbsdev added review:tiny CH: Fixed PR is fixing a bug labels Jan 27, 2020
@stevehobbsdev stevehobbsdev added this to the vNext milestone Jan 27, 2020
@stevehobbsdev stevehobbsdev requested review from a team and removed request for a team January 27, 2020 10:29
@stevehobbsdev stevehobbsdev requested a review from a team January 27, 2020 10:46
@pthieu
Copy link

pthieu commented May 4, 2020

Has this been released? I'm following the tutorial here: https://auth0.com/docs/quickstart/spa/react/01-login

Specifically in the https://auth0.com/docs/quickstart/spa/react/01-login#integrate-the-sdk section, I have the following code:

If I use redirect_uri=http://localhost:3000, it works because /authorize and /oauth/token uses the same redirect_uri. However, if I change the redirect_uri to something else, it fails

<Auth0Provider
    domain={process.env.REACT_APP_AUTH0_DOMAIN}
    client_id={process.env.REACT_APP_AUTH0_CLIENT_ID}
    redirect_uri={'http://localhost:9000'}
    onRedirectCallback={onRedirectCallback}
  >

I get a timeout error in the console.

I check the XHR requests in my Network Tab of Chrome DevTools and see that /authorize is using port 9000 but /oauth/token is still using port 3000, which is the same as window.location.origin.

I am on version ^1.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CH: Fixed PR is fixing a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Authorization code flow sends incorrect redirect_url parameter
3 participants