Skip to main content
Back to JavaScript

User Profile

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://localhost:8090/oauth2/userinfo',
headers: {
Authorization: `Bearer ${accessToken}`,
},
})

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

Parameters

ParameterTypeRequiredDescription
config.urlstringFull 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].

Explore with AI

ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© Copyright Linux Foundation Europe.For web site terms of use, trademark policy and other project policies please see https://linuxfoundation.eu/en/policies.