Oauth2-server: Get back additional information about a user

Created on 8 Aug 2016  路  3Comments  路  Source: thephpleague/oauth2-server

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?

Question

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

All 3 comments

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kohlerdominik picture kohlerdominik  路  6Comments

alessandroraffa picture alessandroraffa  路  5Comments

brutto picture brutto  路  7Comments

gbgelado picture gbgelado  路  3Comments

webmake picture webmake  路  7Comments