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
implementation
pull/890/merge
Bernd Frey 2015-08-20 15:30:49 +02:00 committed by Justin Richer
parent 8d0355a513
commit 9fe98e0132
3 changed files with 12 additions and 2 deletions

View File

@ -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;

View File

@ -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
*/ */

View File

@ -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);
}
} }