v17/Quarkus Charset issue with LinkedIn IdP
See original GitHub issueDescribe the bug
I’m running LinkedIn IdP on Keycloak v17/Quarkus on a staging environment, and v16.1.1/WildFly on a production environment, with same configurations.
Everything is working fine on v16.1.1/WildFly, but on v17/Quarkus my first name which contains a é
accent is not properly synched.
Version
v17.0.0/v17.0.1
Expected behavior
User data grabbed from LinkedIn response should be properly encoded.
Actual behavior
First name is wrong
How to Reproduce?
- Create a linkedin account with a special character like
é
in the first name. - Configure LinkedIn broker in Keycloak Quarkus v17.
- Login with LinkedIn in Keycloak.
- Check the created user in admin UI.
- First name has invalid characters instead of the special one.
Anything else?
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:8 (7 by maintainers)
Top Results From Across the Web
Keycloak 18.0.1 released
#10462 v17/Quarkus Charset issue with LinkedIn IdP keycloak dist/quarkus; #11186 Theme resources are not loaded correctlyusing quarking when ...
Read more >How to resolve UTF-8 Encoding issue in Jenkins - LinkedIn
To resolve the encoding issue we have to add the environment variable in system as shown below first.
Read more >Sreng Mao's Post - IDP synergy - LinkedIn Cambodia
Such an honour and privilege to lead our capable/internationally diverse teams in Cambodia to deliver world class services to our students, parents, ...
Read more >Hema Rathinam on LinkedIn: #bangladesh ...
Talent Acquisition Manager - IDP : Hiring for various positions in South India/Nepal/Bangladesh/Sri Lanka. 11mo Edited.
Read more >IDP Connect USA - LinkedIn
IDP Connect is the strategic partner of choice for institutions seeking access to engaged student communities. As part of IDP Education, the world...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I also encountered the same problem with Keycloak v18/Quarkus with Azure AD as the external IdP.
The problem is happening when the external IdP does not send the charset in the HTTP response. For example, in Azure AD, the response for the UserInfo endpoint is as follows, with no charset.
If Charset is not present, Keycloak’s SimpleHttp class uses the JVM default encoding. This causes garbled characters in some environments. https://github.com/keycloak/keycloak/blob/52ca546cfaa8ffc655a92f54fc35a46eaa23507e/server-spi-private/src/main/java/org/keycloak/broker/provider/util/SimpleHttp.java#L348
As a workaround, we can set the JVM default encoding. Just give
-Dfile.encoding=UTF-8
as a system property. When using the official container, the garbled characters were resolved in my case by starting the following command:I can confirm this issue occurs on other federations as well like Active Directories.