Skip to content

Commit 65db5fa

Browse files
committed
Remove deprecations in JwtAuthenticationConverter
Closes gh-11587
1 parent 1ac6054 commit 65db5fa

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

oauth2/oauth2-resource-server/src/main/java/org/springframework/security/oauth2/server/resource/authentication/JwtAuthenticationConverter.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,26 +40,12 @@ public class JwtAuthenticationConverter implements Converter<Jwt, AbstractAuthen
4040

4141
@Override
4242
public final AbstractAuthenticationToken convert(Jwt jwt) {
43-
Collection<GrantedAuthority> authorities = extractAuthorities(jwt);
43+
Collection<GrantedAuthority> authorities = this.jwtGrantedAuthoritiesConverter.convert(jwt);
4444

4545
String principalClaimValue = jwt.getClaimAsString(this.principalClaimName);
4646
return new JwtAuthenticationToken(jwt, authorities, principalClaimValue);
4747
}
4848

49-
/**
50-
* Extracts the {@link GrantedAuthority}s from scope attributes typically found in a
51-
* {@link Jwt}
52-
* @param jwt The token
53-
* @return The collection of {@link GrantedAuthority}s found on the token
54-
* @deprecated Since 5.2. Use your own custom converter instead
55-
* @see JwtGrantedAuthoritiesConverter
56-
* @see #setJwtGrantedAuthoritiesConverter(Converter)
57-
*/
58-
@Deprecated
59-
protected Collection<GrantedAuthority> extractAuthorities(Jwt jwt) {
60-
return this.jwtGrantedAuthoritiesConverter.convert(jwt);
61-
}
62-
6349
/**
6450
* Sets the {@link Converter Converter&lt;Jwt, Collection&lt;GrantedAuthority&gt;&gt;}
6551
* to use. Defaults to {@link JwtGrantedAuthoritiesConverter}.

0 commit comments

Comments
 (0)