Skip to content

Commit a483db6

Browse files
committed
Temporarily remove validation logic for jwt token-type
Issue gh-60
1 parent 6488243 commit a483db6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: oauth2-authorization-server/src/main/java/org/springframework/security/oauth2/server/authorization/authentication/OAuth2TokenExchangeAuthenticationProvider.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ public Authentication authenticate(Authentication authentication) throws Authent
138138

139139
if (JWT_TOKEN_TYPE_VALUE.equals(tokenExchangeAuthentication.getSubjectTokenType()) &&
140140
!Jwt.class.isAssignableFrom(subjectToken.getToken().getClass())) {
141-
throw new OAuth2AuthenticationException(OAuth2ErrorCodes.INVALID_REQUEST);
141+
// TODO: Need a way to validate subject_token_type, since access tokens
142+
// are always stored as OAuth2AccessToken instead of Jwt.
143+
//throw new OAuth2AuthenticationException(OAuth2ErrorCodes.INVALID_REQUEST);
142144
}
143145

144146
if (subjectAuthorization.getAttribute(Principal.class.getName()) == null) {
@@ -181,7 +183,9 @@ public Authentication authenticate(Authentication authentication) throws Authent
181183

182184
if (JWT_TOKEN_TYPE_VALUE.equals(tokenExchangeAuthentication.getActorTokenType()) &&
183185
!Jwt.class.isAssignableFrom(actorToken.getToken().getClass())) {
184-
throw new OAuth2AuthenticationException(OAuth2ErrorCodes.INVALID_REQUEST);
186+
// TODO: Need a way to validate actor_token_type, since access tokens
187+
// are always stored as OAuth2AccessToken instead of Jwt.
188+
//throw new OAuth2AuthenticationException(OAuth2ErrorCodes.INVALID_REQUEST);
185189
}
186190

187191
if (StringUtils.hasText(authorizedActorSubject) &&

0 commit comments

Comments
 (0)