gravitee-access-management icon indicating copy to clipboard operation
gravitee-access-management copied to clipboard

fix: do not override the preferredLangague field by the locale claim

Open leleueri opened this issue 2 years ago • 1 comments

fixes gravitee-io/issues#8268

How to test

You can use the acceptance tests explain here https://github.com/gravitee-io/issues/issues/8039 The case where the locale claims is updated should works

leleueri avatar Aug 01 '22 18:08 leleueri

Not a huge fan to have a parameter in the getter method.

Seems to only affected the SCIM part of AM, maybe do a change like this in the mapper :

scimUser.setPreferredLanguage(get(additionalInformation, StandardClaims.LOCALE) == null ? user.getPreferredLanguage() : (!get(additionalInformation, StandardClaims.LOCALE).equals(user.getPreferredLanguage()) ? user.getPreferredLanguage() : get(additionalInformation, StandardClaims.LOCALE)));

It is not only about SCIM but also about UserProperties provided to the template engines. IMHO we shouldn't persist/override the preferredLanguage using the standard locale claims (even in SCIM)

leleueri avatar Sep 05 '22 15:09 leleueri

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Sep 05 '22 19:09 sonarqubecloud[bot]