When setting up UserManager on the oidc-client-ts TypeScript module using the config object below:
var config = {
authority: "https://localhost:3000",
client_id: "js",
redirect_uri: "https://localhost:3001/callback.html",
response_type: "code",
scope: "openid profile IdentityServerApi colour",
post_logout_redirect_uri: "https://localhost:3001/index.html",
}
The usermanager.getUser function returns a user object with specific profile claims:
{
"iss": "https://localhost:3000",
"iat": 1681658331,
"exp": 1681658631,
"aud": "js",
"sid": "E5E4621779C8970433CEE2E6472FF8DE",
"sub": "cc23a1a1-a8ff-4caf-8fef-555d98923b8a",
"idp": "local"
}
However, when using the same config with oidc-client-js, the profile object returned is different:
{
"amr": [
"pwd"
],
"sid": "32A90BF8B0EBF7780BC9B8E0AD3DDE8B",
"sub": "cc23a1a1-a8ff-4caf-8fef-555d98923b8a",
"auth_time": 1681659272,
"idp": "local",
"name": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fe8a969b9f9a939790be9b939f9792d09d9193">[email protected]</a>",
"preferred_username": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bdc9d5d8dcd9d0d4d3fdd8d0dcd4d193ded2d0">[email protected]</a>",
"favorite_colour": "FAVORITECOLOUR_DEFAULT"
}
I have attempted to update the config with additional values as suggested by the documentation, but they do not seem to affect the results being returned:
{
...
client_authentication: "client_secret_post",
loadUserInfo: true,
mergeClaims: true,
filterProtocolClaims: false
}
There seems to be an issue with the number of times userClaims are requested during login. The ts module requests them twice, while the js module requests them three times.
Could this issue be related to the configuration used for setting up the UserManager or the redirection process?
Here is the config used for UserManager on the client callback page:
{
authority: "https://localhost:3000",
response_mode: "query",
client_id: "js",
redirect_uri: "https://localhost:3001/callback.html",
}
I may not fully understand oAuth, but I am puzzled by the discrepancies in profile data between the two versions despite identical configurations.