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

Add custom callback handling #37

Merged
merged 6 commits into from
Dec 13, 2019
Merged

Add custom callback handling #37

merged 6 commits into from
Dec 13, 2019

Conversation

joshcanhelp
Copy link
Contributor

@joshcanhelp joshcanhelp commented Nov 20, 2019

Description

Add the ability to do custom callback handling. Used to store/process incoming authorization artifacts or other login-time transactions. See EXAMPLES.md for how to use this option.

Testing

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

Checklist

  • All active GitHub checks for tests, formatting, and security are passing
  • The correct base branch is being used, if not master

@joshcanhelp
Copy link
Contributor Author

@jfromaniello @hzalaz - Would be curious to get your feedback on this approach. We want a provide a way to do some additional validation/processing/etc on the callback route before we call the user signed in.

@panva
Copy link
Contributor

panva commented Nov 27, 2019

@joshcanhelp

If this example's going to end up in a README please adjust the client.userinfo call to get the TokenSet instance as an argument.

@joshcanhelp joshcanhelp changed the title First pass at adding custom callback processing Add custom callback handling Dec 10, 2019
@joshcanhelp joshcanhelp added this to the v0.6.0 milestone Dec 10, 2019
@joshcanhelp joshcanhelp marked this pull request as ready for review December 10, 2019 21:24
@joshcanhelp
Copy link
Contributor Author

@joshcanhelp joshcanhelp requested a review from a team December 10, 2019 21:24
@joshcanhelp joshcanhelp mentioned this pull request Dec 10, 2019
4 tasks
@panva
Copy link
Contributor

panva commented Dec 11, 2019

Copy link
Member

@jfromaniello jfromaniello left a comment

Choose a reason for hiding this comment

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

Looks good!

EXAMPLES.md Outdated
handleCallback: async function (req, res, next) {
const client = req.openid.client;
try {
req.session.openidTokens.userinfo = await client.userinfo(req.session.openidTokens);
Copy link
Member

Choose a reason for hiding this comment

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

Why storing the userInfo in the TokenSet instead of just in the session?

@joshcanhelp joshcanhelp merged commit 607f166 into auth0:master Dec 13, 2019
@joshcanhelp joshcanhelp deleted the add-custom-callback-processing branch December 13, 2019 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants