Skip to content

Commit

Permalink
Update AutodeskAuthenticationOptions.cs to v2
Browse files Browse the repository at this point in the history
Autodesk is deprecating the v1 APIs, and moving to v2. 

Updates where claims are sourced from using the new APIs, as documented at https://aps.autodesk.com/en/docs/oauth/v2/reference/http/userinfo-GET/

Note that the 2fa claim is removed due to the informatio no longer being provided by the Autodesk API.
  • Loading branch information
ClaysonIO authored Jun 23, 2023
1 parent b5c152c commit 4e7da70
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ public AutodeskAuthenticationOptions()

Scope.Add("user-profile:read");

ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "userId");
ClaimActions.MapJsonKey(ClaimTypes.Name, "userName");
ClaimActions.MapJsonKey(ClaimTypes.GivenName, "firstName");
ClaimActions.MapJsonKey(ClaimTypes.Surname, "lastName");
ClaimActions.MapJsonKey(ClaimTypes.Email, "emailId");
ClaimActions.MapJsonKey(Claims.EmailVerified, "emailVerified");
ClaimActions.MapJsonKey(Claims.TwoFactorEnabled, "2FaEnabled");
ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "sub");
ClaimActions.MapJsonKey(ClaimTypes.Name, "preferred_username");
ClaimActions.MapJsonKey(ClaimTypes.GivenName, "given_name");
ClaimActions.MapJsonKey(ClaimTypes.Surname, "family_name");
ClaimActions.MapJsonKey(ClaimTypes.Email, "email");
ClaimActions.MapJsonKey(Claims.EmailVerified, "email_verified");
}
}

0 comments on commit 4e7da70

Please sign in to comment.