-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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
[New] Added oauth2 userinfo endpoint #6554
Conversation
|
||
accessToken = req.headers.authorization.replace('Bearer ', '') | ||
|
||
token = oauth2server.oauth.model.AccessTokens.findOne accessToken: accessToken |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is return an exception if the token was not found?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added checks on this and the user.
|
||
token = oauth2server.oauth.model.AccessTokens.findOne accessToken: accessToken | ||
|
||
user = RocketChat.models.Users.findOneById(token.userId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a check here as well
@RocketChat/core
Added as per part of the spec: https://connect2id.com/products/server/docs/api/userinfo
Ran into an application that needed this on the server to finish the oauth login process. Since its part of the spec, I went ahead and added it.