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
32950bfe
Commit
32950bfe
authored
Nov 06, 2016
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7299 from vpavic:resource-server-config
* pr/7299: Fix JWT token URI derivation
parents
4311cf33
5783cd55
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
ResourceServerProperties.java
...re/security/oauth2/resource/ResourceServerProperties.java
+2
-2
ResourceServerPropertiesTests.java
...curity/oauth2/resource/ResourceServerPropertiesTests.java
+11
-2
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ResourceServerProperties.java
View file @
32950bfe
/*
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
6
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -246,7 +246,7 @@ public class ResourceServerProperties implements Validator, BeanFactoryAware {
...
@@ -246,7 +246,7 @@ public class ResourceServerProperties implements Validator, BeanFactoryAware {
if
(
ResourceServerProperties
.
this
.
tokenInfoUri
!=
null
if
(
ResourceServerProperties
.
this
.
tokenInfoUri
!=
null
&&
ResourceServerProperties
.
this
.
tokenInfoUri
&&
ResourceServerProperties
.
this
.
tokenInfoUri
.
endsWith
(
"/check_token"
))
{
.
endsWith
(
"/check_token"
))
{
return
ResourceServerProperties
.
this
.
user
InfoUri
.
replace
(
"/check_token"
,
return
ResourceServerProperties
.
this
.
token
InfoUri
.
replace
(
"/check_token"
,
"/token_key"
);
"/token_key"
);
}
}
return
null
;
return
null
;
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ResourceServerPropertiesTests.java
View file @
32950bfe
...
@@ -27,6 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -27,6 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* Tests for {@link ResourceServerProperties}.
* Tests for {@link ResourceServerProperties}.
*
*
* @author Dave Syer
* @author Dave Syer
* @author Vedran Pavic
*/
*/
public
class
ResourceServerPropertiesTests
{
public
class
ResourceServerPropertiesTests
{
...
@@ -45,9 +46,17 @@ public class ResourceServerPropertiesTests {
...
@@ -45,9 +46,17 @@ public class ResourceServerPropertiesTests {
}
}
@Test
@Test
public
void
tokenKeyDerived
()
throws
Exception
{
public
void
tokenKeyDerived
FromUserInfoUri
()
throws
Exception
{
this
.
properties
.
setUserInfoUri
(
"http://example.com/userinfo"
);
this
.
properties
.
setUserInfoUri
(
"http://example.com/userinfo"
);
assertThat
(
this
.
properties
.
getJwt
().
getKeyUri
()).
isNotNull
();
assertThat
(
this
.
properties
.
getJwt
().
getKeyUri
())
.
isEqualTo
(
"http://example.com/token_key"
);
}
@Test
public
void
tokenKeyDerivedFromTokenInfoUri
()
throws
Exception
{
this
.
properties
.
setTokenInfoUri
(
"http://example.com/check_token"
);
assertThat
(
this
.
properties
.
getJwt
().
getKeyUri
())
.
isEqualTo
(
"http://example.com/token_key"
);
}
}
}
}
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