File tree Expand file tree Collapse file tree
src/main/java/de/kaleidox/workbench Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 <option name =" HOST" value =" gman.comroid.org" />
88 <option name =" PORT" value =" 5005" />
99 <option name =" AUTO_RESTART" value =" false" />
10+ <RunnerSettings RunnerId =" Debug" >
11+ <option name =" DEBUG_PORT" value =" 5005" />
12+ <option name =" LOCAL" value =" false" />
13+ </RunnerSettings >
1014 <method v =" 2" />
1115 </configuration >
1216</component >
Original file line number Diff line number Diff line change @@ -8,6 +8,5 @@ public record OAuth2Info(
88 String redirectUrl ,
99 String authorizationUrl ,
1010 String tokenUrl ,
11- String userInfoUrl ,
12- String userNameAttributeName
11+ String userInfoUrl
1312) {}
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 (). replaceAll ( " \\ ." , "" ) )
51+ .userNameAttributeName ("userid" )
5252 .build ())
5353 .toArray (ClientRegistration []::new );
5454 return registrations .length == 0 ? null : new InMemoryClientRegistrationRepository (registrations );
@@ -99,18 +99,15 @@ public String getUsername() {
9999 @ EventListener
100100 public void on (ApplicationStartedEvent ignored ) {
101101 setAttributesConverter (input -> source -> {
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 )
102+ var userId = new SpelExpressionParser ().parseRaw ("ocs.data.id" )
109103 .getValue (SimpleEvaluationContext .forPropertyAccessors (new MapAccessor ())
110104 .withRootObject (source )
111105 .build ());
112106
113- source .put (userNameAttributeName .replaceAll ("\\ ." , "" ), userId );
107+ source .put (input .getClientRegistration ()
108+ .getProviderDetails ()
109+ .getUserInfoEndpoint ()
110+ .getUserNameAttributeName (), userId );
114111 return source ;
115112 });
116113 }
You can’t perform that action at this time.
0 commit comments