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

[SDK-3911] Add support for providing a custom callback route #438

Merged
merged 2 commits into from
Jan 24, 2023

Conversation

ewanharris
Copy link
Contributor

Description

Adds support for providing a custom callback route similar to the existing support for a custom login and logout route. When providing this route, the login route should always be provided so that the authorizationParams.redirect_uri value can be provided as this can no longer be inferred from config/defaults.

The options for this accept a tokenEndpointParams that is the same as the existing config option of tokenEndpointParams, just with the added benefit that these can be configured per request not just once for the app.

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 the default branch

@ewanharris ewanharris requested a review from a team as a code owner January 20, 2023 16:13
@ewanharris ewanharris changed the title Add support for providing a custom callback route [SDK-3911] Add support for providing a custom callback route Jan 20, 2023
Comment on lines +27 to +33
app.get('/login', (req, res) =>
res.oidc.login({
returnTo: '/profile',
authorizationParams: {
redirect_uri: 'http://localhost:3000/callback',
},
})

Check failure

Code scanning / CodeQL

Missing rate limiting

This route handler performs [authorization](1), but is not rate-limited.
Copy link
Contributor

@adamjmcgrath adamjmcgrath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm - couple of things

EXAMPLES.md Outdated Show resolved Hide resolved
EXAMPLES.md Outdated Show resolved Hide resolved
EXAMPLES.md Outdated Show resolved Hide resolved
examples/custom-routes.js Outdated Show resolved Hide resolved
examples/custom-routes.js Outdated Show resolved Hide resolved
test/callback.tests.js Outdated Show resolved Hide resolved
test/callback.tests.js Outdated Show resolved Hide resolved
@ewanharris ewanharris force-pushed the feat/SDK-3911-custom-callback branch from cc87d20 to b404d06 Compare January 24, 2023 11:17
Copy link
Contributor

@adamjmcgrath adamjmcgrath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@adamjmcgrath adamjmcgrath merged commit 523643e into master Jan 24, 2023
@adamjmcgrath adamjmcgrath deleted the feat/SDK-3911-custom-callback branch January 24, 2023 12:31
@adamjmcgrath adamjmcgrath mentioned this pull request Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants