Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
7bbeeaa4
Commit
7bbeeaa4
authored
Apr 12, 2019
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build following Spring Security changes
parent
8fd8a9b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
OAuth2ResourceServerJwtConfiguration.java
...esource/servlet/OAuth2ResourceServerJwtConfiguration.java
+3
-1
OAuth2ResourceServerAutoConfigurationTests.java
...e/servlet/OAuth2ResourceServerAutoConfigurationTests.java
+2
-2
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerJwtConfiguration.java
View file @
7bbeeaa4
...
...
@@ -28,6 +28,7 @@ import org.springframework.boot.autoconfigure.security.oauth2.resource.OAuth2Res
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Conditional
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.security.oauth2.jose.jws.SignatureAlgorithm
;
import
org.springframework.security.oauth2.jwt.JwtDecoder
;
import
org.springframework.security.oauth2.jwt.JwtDecoders
;
import
org.springframework.security.oauth2.jwt.NimbusJwtDecoder
;
...
...
@@ -53,7 +54,8 @@ class OAuth2ResourceServerJwtConfiguration {
@ConditionalOnMissingBean
public
JwtDecoder
jwtDecoderByJwkKeySetUri
()
{
return
NimbusJwtDecoder
.
withJwkSetUri
(
this
.
properties
.
getJwkSetUri
())
.
jwsAlgorithm
(
this
.
properties
.
getJwsAlgorithm
()).
build
();
.
jwsAlgorithm
(
SignatureAlgorithm
.
from
(
this
.
properties
.
getJwsAlgorithm
()))
.
build
();
}
@Bean
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/servlet/OAuth2ResourceServerAutoConfigurationTests.java
View file @
7bbeeaa4
...
...
@@ -102,7 +102,7 @@ public class OAuth2ResourceServerAutoConfigurationTests {
public
void
autoConfigurationShouldConfigureResourceServerWithJwsAlgorithm
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.security.oauth2.resourceserver.jwt.jwk-set-uri=https://jwk-set-uri.com"
,
"spring.security.oauth2.resourceserver.jwt.jws-algorithm=
HS512
"
)
"spring.security.oauth2.resourceserver.jwt.jws-algorithm=
RS384
"
)
.
run
((
context
)
->
{
JwtDecoder
jwtDecoder
=
context
.
getBean
(
JwtDecoder
.
class
);
Object
processor
=
ReflectionTestUtils
.
getField
(
jwtDecoder
,
...
...
@@ -110,7 +110,7 @@ public class OAuth2ResourceServerAutoConfigurationTests {
Object
keySelector
=
ReflectionTestUtils
.
getField
(
processor
,
"jwsKeySelector"
);
assertThat
(
keySelector
).
hasFieldOrPropertyWithValue
(
"jwsAlg"
,
JWSAlgorithm
.
HS512
);
JWSAlgorithm
.
RS384
);
assertThat
(
getBearerTokenFilter
(
context
)).
isNotNull
();
});
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment