Fix for "updatedAt" user attribute in "profile" client scope should use number instead of String (#11020)

Closes #10081


Co-authored-by: Indrajit Ingawale <iingawal@iingawal.pnq.csb>
This commit is contained in:
iingawal 2022-03-31 18:03:03 +05:30 committed by GitHub
parent aacae9b9ac
commit 6016b461db
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -161,7 +161,7 @@ public class OIDCLoginProtocolFactory extends AbstractLoginProtocolFactory {
createUserAttributeMapper(GENDER, "gender", IDToken.GENDER, "String");
createUserAttributeMapper(BIRTHDATE, "birthdate", IDToken.BIRTHDATE, "String");
createUserAttributeMapper(ZONEINFO, "zoneinfo", IDToken.ZONEINFO, "String");
createUserAttributeMapper(UPDATED_AT, "updatedAt", IDToken.UPDATED_AT, "String");
createUserAttributeMapper(UPDATED_AT, "updatedAt", IDToken.UPDATED_AT, "long");
createUserAttributeMapper(LOCALE, "locale", IDToken.LOCALE, "String");
createUserAttributeMapper(PHONE_NUMBER, "phoneNumber", IDToken.PHONE_NUMBER, "String");

View file

@ -91,6 +91,7 @@ public class OIDCScopeTest extends AbstractOIDCScopeTest {
attrs.add("street", "Elm 5");
attrs.add("phoneNumber", "111-222-333");
attrs.add("phoneNumberVerified", "true");
attrs.add("updatedAt", "1643282255");
user.setAttributes(attrs);
testRealm.getUsers().add(user);
@ -218,6 +219,7 @@ public class OIDCScopeTest extends AbstractOIDCScopeTest {
Assert.assertEquals("John", idToken.getGivenName());
Assert.assertEquals("Doe", idToken.getFamilyName());
Assert.assertEquals("John Doe", idToken.getName());
Assert.assertEquals(new Long(1643282255L),idToken.getUpdatedAt());
} else {
Assert.assertNull(idToken.getPreferredUsername());
Assert.assertNull(idToken.getGivenName());