OIDCAuthenticationFilter: Make authenticationSignerService optional so
it must not be provided in Spring config OIDCAuthenticationProvider: Setter for UserInfoFetcher, so own implementation can be wired UserInfoFetcher: Call to DefaultUserInfo.fromJson moved to method, so it can be overwritten by own implementation to use own UserInfo implementationpull/890/merge
parent
8d0355a513
commit
9fe98e0132
|
@ -110,7 +110,7 @@ public class OIDCAuthenticationFilter extends AbstractAuthenticationProcessingFi
|
||||||
private SymmetricKeyJWTValidatorCacheService symmetricCacheService;
|
private SymmetricKeyJWTValidatorCacheService symmetricCacheService;
|
||||||
|
|
||||||
// signer based on keypair for this client (for outgoing auth requests)
|
// signer based on keypair for this client (for outgoing auth requests)
|
||||||
@Autowired
|
@Autowired(required=false)
|
||||||
private JWTSigningAndValidationService authenticationSignerService;
|
private JWTSigningAndValidationService authenticationSignerService;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,6 +99,13 @@ public class OIDCAuthenticationProvider implements AuthenticationProvider {
|
||||||
token.getIdToken(), token.getAccessTokenValue(), token.getRefreshTokenValue());
|
token.getIdToken(), token.getAccessTokenValue(), token.getRefreshTokenValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param userInfoFetcher
|
||||||
|
*/
|
||||||
|
public void setUserInfoFetcher(UserInfoFetcher userInfoFetcher) {
|
||||||
|
this.userInfoFetcher = userInfoFetcher;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param authoritiesMapper
|
* @param authoritiesMapper
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class UserInfoFetcher {
|
||||||
|
|
||||||
JsonObject userInfoJson = new JsonParser().parse(userInfoString).getAsJsonObject();
|
JsonObject userInfoJson = new JsonParser().parse(userInfoString).getAsJsonObject();
|
||||||
|
|
||||||
UserInfo userInfo = DefaultUserInfo.fromJson(userInfoJson);
|
UserInfo userInfo = fromJson(userInfoJson);
|
||||||
|
|
||||||
return userInfo;
|
return userInfo;
|
||||||
} else {
|
} else {
|
||||||
|
@ -123,4 +123,7 @@ public class UserInfoFetcher {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected UserInfo fromJson(JsonObject userInfoJson) {
|
||||||
|
return DefaultUserInfo.fromJson(userInfoJson);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue