Userinfo

GET {{authPath}}/{{envID}}/as/userinfo

The UserInfo Endpoint is an OAuth 2.0 protected resource that returns claims about the authenticated end user. Note that the /{{envID}}/as/userinfo request takes an access token in the Authorization header to get the claims about the user.

curl -X GET \ 'https://auth.pingone.com/{{envID}}/as/userinfo' \ -H 'Authorization: Bearer token'

Userinfo authorization requests

A userinfo authorization request is used with applications associated with the openid resource. The value for the Authorization header is the Bearer token returned by the following authorization request:

https://auth.pingone.com/{{envID}}/as/authorize?client_id={{appID}}&redirect_uri={{redirect_uri}}&response_type=token&scope=openid profile email address

In the authorization request, the scope attribute must specify the openid value, which includes the sub claim (the user ID) in the response data. Additional OpenID Connect scopes such as profile, address, phone and email can also be included to add more user claims to the response.

Grants and scopes with userinfo

The token used with the /{{envID}}/as/userinfo endpoint must be generated by an implicit or authorization_code grant type. PingOne user scopes such as p1:reset:userPassword are not applicable to userinfo authorization requests and applications associated with the openid resource.

Note: Access tokens generated from a client_credentials grant type return an ACCESS_FAILED message when used with the /{{envID}}/as/userinfo endpoint. Tokens from a client_credentials grant use administrator permissions granted through role assignments.

RESPONSES

status: OK

{"family_name":"Doe","address":{"country":"US","postal_code":"78750","region":"TX","locality":"Austin","street_address":"123 Happy Street"},"given_name":"John","email":"jdoe@example.com","preferred_username":"jdoe","updated_at":1535377850,"name":"John Doe","middle_name":"J","sub":"0986b513-ae1f-4312-8d8d-a31eb79133ad"}