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

Create a userInfoGET endpoint in OAuth2 #880

Closed
porcellus opened this issue Jul 9, 2024 · 0 comments
Closed

Create a userInfoGET endpoint in OAuth2 #880

porcellus opened this issue Jul 9, 2024 · 0 comments

Comments

@porcellus
Copy link
Collaborator

porcellus commented Jul 9, 2024

  • it should be exposed by the OAuth2 recipe
  • we want it to be available using an oauth2 access token (if it doesn't exists by the time you start, you can add a stub function for validateOAuth2AccessToken
  • it should have a related buildUserInfo in the RecipeInterface (a stub for this has been added, but feel free to modify it)
  • other recipes should be able to add their own "build" functions. check addClaimFromOtherRecipe
  • the API logic looks roughly like this:
  1. validate the incoming access token
  2. build the default user info in an overrideable buildUserInfo function:
  3. create the basic user info (email, phone number, userid, etc) based on the scopes
  4. call the functions set by other recipes passing the scopes, access token and userId to them and merging the result into the existing user info object (you can add params if you think something else is necessary)
  5. return the user info object that we got back from buildUserInfo
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

No branches or pull requests

2 participants