The signed-in user's claims
const url = 'https://api.nsin.ir/oauth/userinfo';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.nsin.ir/oauth/userinfo \ --header 'Authorization: Bearer <token>'The OIDC UserInfo endpoint. Returns the claims the token’s scopes allow
— nothing more, and nothing at all beyond sub without profile,
email or phone.
The token is verified here directly: signature, expiry, the client still being active, the account still being active, and the underlying NSIN session still being live. Signing out of NSIN therefore takes this endpoint away from a relying party within the access-token lifetime.
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”Claims.
object
The NSIN user id
Unix seconds of the last profile change.
Scope profile.
Scope email.
Scope email.
Scope phone.
Scope phone.
First-party clients only.
First-party clients with scope nsin:identity only.
First-party clients with scope nsin:identity only.
Example generated
{ "sub": "example", "updated_at": 1, "name": "example", "email": "example", "email_verified": true, "phone_number": "example", "phone_number_verified": true, "admin": true, "national_code": "example", "birth_date": "example"}invalid_token — missing, malformed, expired or revoked. Carries a
WWW-Authenticate: Bearer header.
The RFC 6749 error shape, used by the NSIN SSO endpoints only. It is
deliberately different from Error: OAuth clients match on the machine
error code, and only show error_description to a developer.
object
The machine-readable code.
A human-readable explanation. Never match on this.
Example
{ "error": "invalid_grant", "error_description": "authorization code is invalid or expired"}