Skip to main content

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].

ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© WSO2 LLC. All rights reserved.Privacy PolicyCookie Policy