Skip to content

Commit 9fe98e0

Browse files
BerndFreyjricher
authored andcommitted
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
1 parent 8d0355a commit 9fe98e0

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

openid-connect-client/src/main/java/org/mitre/openid/connect/client/OIDCAuthenticationFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public class OIDCAuthenticationFilter extends AbstractAuthenticationProcessingFi
110110
private SymmetricKeyJWTValidatorCacheService symmetricCacheService;
111111

112112
// signer based on keypair for this client (for outgoing auth requests)
113-
@Autowired
113+
@Autowired(required=false)
114114
private JWTSigningAndValidationService authenticationSignerService;
115115

116116

openid-connect-client/src/main/java/org/mitre/openid/connect/client/OIDCAuthenticationProvider.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,13 @@ protected Authentication createAuthenticationToken(PendingOIDCAuthenticationToke
9999
token.getIdToken(), token.getAccessTokenValue(), token.getRefreshTokenValue());
100100
}
101101

102+
/**
103+
* @param userInfoFetcher
104+
*/
105+
public void setUserInfoFetcher(UserInfoFetcher userInfoFetcher) {
106+
this.userInfoFetcher = userInfoFetcher;
107+
}
108+
102109
/**
103110
* @param authoritiesMapper
104111
*/

openid-connect-client/src/main/java/org/mitre/openid/connect/client/UserInfoFetcher.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ protected ClientHttpRequest createRequest(URI url, HttpMethod method) throws IOE
109109

110110
JsonObject userInfoJson = new JsonParser().parse(userInfoString).getAsJsonObject();
111111

112-
UserInfo userInfo = DefaultUserInfo.fromJson(userInfoJson);
112+
UserInfo userInfo = fromJson(userInfoJson);
113113

114114
return userInfo;
115115
} else {
@@ -123,4 +123,7 @@ protected ClientHttpRequest createRequest(URI url, HttpMethod method) throws IOE
123123

124124
}
125125

126+
protected UserInfo fromJson(JsonObject userInfoJson) {
127+
return DefaultUserInfo.fromJson(userInfoJson);
128+
}
126129
}

0 commit comments

Comments
 (0)