Skip to main content

User Profile

Cloud has the newest features. Some may not be in a release yet; the newest release is Identity & Access Management 7.3.0.

These functions read and update user profile data from the OIDC userinfo endpoint.

getUserInfo(config)​

Fetch user claims from the OIDC userinfo endpoint. Requires a valid access token attached to the request.

import { getUserInfo } from '@thunderid/javascript'

const user = await getUserInfo({
url: 'https://<DATA_PLANE_URL>/oauth2/userinfo',
headers: {
Authorization: `Bearer ${accessToken}`,
},
})

console.log(user.email, user.displayName)

Parameters​

ParameterTypeRequiredDescription
config.urlstring✅Full userinfo endpoint URL
config.headersRecord<string, string>❌Request headers. Include Authorization: Bearer <token>

Response: User​

PropertyTypeDescription
substringSubject identifier (unique user ID)
displayNamestringUser's display name
usernamestringUsername
emailstringEmail address
given_namestringFirst name
family_namestringLast name
picturestringProfile picture URL

Additional claims returned by the server are accessible as user[claimUri].

Was this page helpful?