5. Requesting for Userinfo
The /userinfo
endpoint is used by Myinfo (v5)
apps to retrieve user information. You will need the access token (obtained from token exchange) to be able to retrieve the information.
The endpoint will only return information based on the scopes that you have requested when making the authorization request.
Request
Just like the authorization request and token request, you will need to include the DPoP header when making the /userinfo
request. You will also need to include your access token in the Authorization
header.
No query parameters are required for this request.
Response
The response body will contain a JSON Web Signature (JWS), which is also encrypted via JSON Web Encryption (JWE), represented in compact seralization form. This is the same encryption and signature scheme that was used in our ID token encryption, so you can decrypt and verify the response in exactly the same manner.
The decrypted (and decoded) response is a JSON object with the following fields:
person_info
The personal data of the user. The information returned in this field depends on the scopes that were requested in your authorization request.
A JSON object that follows the Myinfo Get Person response.
iss
The issuer identifier of our authorization server. This is identical to the iss
returned in the ID token.
String
iat
The unix timestamp at which we issued this JWT.
String
sub
The principal that is the subject of the JWT. Contains a globally unique identifier for the user. This is identical to the sub
returned in the ID token.
String
aud
The client ID of your registered client, provided by Singpass during app onboarding.
A 32-character case-sensitive alphanumeric string.
The examples below show how the response would look like if openid uinfin name
were the requested scopes.
Last updated
Was this helpful?