If I'm using the oauth2-server to log people in to my application, I'd like to get some additional information back from the server about the user that's logged in -- their email address, for example, which the oauth2-server knows (because it's their login username). How do I ask for that? Is that to do with scopes?
There are two methods:
1) Create an API endpoint that a client can send a request to (along with the access token) which will return the user details (based on the user identified by the access token).
2) With OpenID Connect you can ask for an "id token" along with an access token which returns an OpenID claims set. I'm working to add OpenID support natively into this library but it's a really big specification.
For now, I'd go with option 1
I guess this is OpenID Connect 1.0 actually, https://openid.net/specs/openid-connect-core-1_0.html#StandardClaims
This is related to #442
Most helpful comment
There are two methods:
1) Create an API endpoint that a client can send a request to (along with the access token) which will return the user details (based on the user identified by the access token).
2) With OpenID Connect you can ask for an "id token" along with an access token which returns an OpenID claims set. I'm working to add OpenID support natively into this library but it's a really big specification.
For now, I'd go with option 1