This repository was archived by the owner on Jun 11, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
src/main/java/de/kaleidox/workbench/web Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ public class SecurityConfig extends DefaultOAuth2UserService {
4848 .authorizationUri (info .authorizationUrl ())
4949 .tokenUri (info .tokenUrl ())
5050 .userInfoUri (info .userInfoUrl ())
51- .userNameAttributeName (info .userNameAttributeName ())
51+ .userNameAttributeName (info .userNameAttributeName (). replaceAll ( " \\ ." , "" ) )
5252 .build ())
5353 .toArray (ClientRegistration []::new );
5454 return registrations .length == 0 ? null : new InMemoryClientRegistrationRepository (registrations );
@@ -99,15 +99,18 @@ public String getUsername() {
9999 @ EventListener
100100 public void on (ApplicationStartedEvent ignored ) {
101101 setAttributesConverter (input -> source -> {
102- if (!source .containsKey ("ocs" )) return source ;
103- var userId = new SpelExpressionParser ().parseRaw ("ocs.data.id" )
102+ var userNameAttributeName = input .getClientRegistration ()
103+ .getProviderDetails ()
104+ .getUserInfoEndpoint ()
105+ .getUserNameAttributeName ();
106+ if (!userNameAttributeName .contains ("." )) return source ;
107+
108+ var userId = new SpelExpressionParser ().parseRaw (userNameAttributeName )
104109 .getValue (SimpleEvaluationContext .forPropertyAccessors (new MapAccessor ())
105110 .withRootObject (source )
106111 .build ());
107- source .put (input .getClientRegistration ()
108- .getProviderDetails ()
109- .getUserInfoEndpoint ()
110- .getUserNameAttributeName (), userId );
112+
113+ source .put (userNameAttributeName .replaceAll ("\\ ." , "" ), userId );
111114 return source ;
112115 });
113116 }
You can’t perform that action at this time.
0 commit comments