Function: fetchUserInfo()

August 29, 2025 ยท View on GitHub

๐Ÿ’— Help the project

Support from the community to continue maintaining and improving this module is welcome. If you find the module useful, please consider supporting the project by becoming a sponsor.


โ–ธ fetchUserInfo(config, accessToken, expectedSubject, options?): Promise<UserInfoResponse>

Performs a UserInfo Request at the userinfo endpoint and returns the parsed UserInfo claims from either its JSON or JWT response.

Authorization Header is used to transmit the Access Token value. No other Access Token means of transport are supported.

Parameters

ParameterTypeDescription
configConfiguration-
accessTokenstringOAuth 2.0 Access Token
expectedSubjectstring | typeof skipSubjectCheckExpected sub claim value. In response to OpenID Connect authentication requests, the expected subject is the one from the ID Token claims retrieved from TokenEndpointResponseHelpers.claims which is available on all returned Token Endpoint responses.
options?DPoPOptions-

Returns

Promise<UserInfoResponse>

See

OpenID Connect Core 1.0