@@ -2703,6 +2703,20 @@ export class FusionAuthClient {
27032703 . go ( ) ;
27042704 }
27052705
2706+ /**
2707+ * Call the UserInfo endpoint to retrieve User Claims from the access token issued by FusionAuth.
2708+ *
2709+ * @param {string } encodedJWT The encoded JWT (access token).
2710+ * @returns {Promise<ClientResponse<UserResponse>> }
2711+ */
2712+ retrieveUserInfoFromAccessToken ( encodedJWT : string ) : Promise < ClientResponse < UserResponse > > {
2713+ return this . startAnonymous < UserResponse , OAuthError > ( )
2714+ . withUri ( '/oauth2/userinfo' )
2715+ . withAuthorization ( 'Bearer ' + encodedJWT )
2716+ . withMethod ( "GET" )
2717+ . go ( ) ;
2718+ }
2719+
27062720 /**
27072721 * Retrieves the login report between the two instants for a particular user by Id. If you specify an application id, it will only return the
27082722 * login counts for that application.
@@ -3393,21 +3407,6 @@ export class FusionAuthClient {
33933407 . go ( ) ;
33943408 }
33953409
3396- /**
3397- * Call the UserInfo endpoint to retrieve User Claims from the access token issued by FusionAuth.
3398- *
3399- * @param {string } encodedJWT The encoded JWT (access token).
3400- * @returns {Promise<ClientResponse<UserResponse>> }
3401- */
3402- userInfo ( encodedJWT : string ) : Promise < ClientResponse < UserResponse > > {
3403- return this . startAnonymous < UserResponse , OAuthError > ( )
3404- . withHeader ( 'Content-Type' , 'text/plain' )
3405- . withUri ( '/oauth2/userinfo' )
3406- . withAuthorization ( 'Bearer ' + encodedJWT )
3407- . withMethod ( "POST" )
3408- . go ( ) ;
3409- }
3410-
34113410 /**
34123411 * Validates the end-user provided user_code from the user-interaction of the Device Authorization Grant.
34133412 * If you build your own activation form you should validate the user provided code prior to beginning the Authorization grant.
0 commit comments