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
565f7543
Commit
565f7543
authored
Jan 05, 2017
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
83ed8fb0
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
29 additions
and
25 deletions
+29
-25
OAuth2ResourceServerConfiguration.java
...ty/oauth2/resource/OAuth2ResourceServerConfiguration.java
+2
-4
ResourceServerProperties.java
...re/security/oauth2/resource/ResourceServerProperties.java
+1
-1
OAuth2AutoConfigurationTests.java
...nfigure/security/oauth2/OAuth2AutoConfigurationTests.java
+1
-2
pom.xml
spring-boot-dependencies/pom.xml
+4
-2
appendix-application-properties.adoc
...cs/src/main/asciidoc/appendix-application-properties.adoc
+1
-0
spring-boot-features.adoc
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
+4
-3
SampleSecureOAuth2ResourceApplicationTests.java
.../resource/SampleSecureOAuth2ResourceApplicationTests.java
+3
-3
pom.xml
...samples/spring-boot-sample-secure-oauth2-resource/pom.xml
+2
-1
Flight.java
...e/src/main/java/sample/secure/oauth2/resource/Flight.java
+1
-1
FlightRepository.java
.../java/sample/secure/oauth2/resource/FlightRepository.java
+1
-1
SampleSecureOAuth2ResourceApplication.java
...auth2/resource/SampleSecureOAuth2ResourceApplication.java
+1
-1
SampleSecureOAuth2ResourceApplicationTests.java
.../resource/SampleSecureOAuth2ResourceApplicationTests.java
+4
-3
SampleSecureOAuth2ApplicationTests.java
...ple/secure/oauth2/SampleSecureOAuth2ApplicationTests.java
+4
-3
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/OAuth2ResourceServerConfiguration.java
View file @
565f7543
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
@@ -18,7 +18,6 @@ package org.springframework.boot.autoconfigure.security.oauth2.resource;
...
@@ -18,7 +18,6 @@ package org.springframework.boot.autoconfigure.security.oauth2.resource;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.BeansException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.config.BeanPostProcessor
;
import
org.springframework.beans.factory.config.BeanPostProcessor
;
import
org.springframework.boot.autoconfigure.condition.ConditionMessage
;
import
org.springframework.boot.autoconfigure.condition.ConditionMessage
;
import
org.springframework.boot.autoconfigure.condition.ConditionOutcome
;
import
org.springframework.boot.autoconfigure.condition.ConditionOutcome
;
...
@@ -106,9 +105,8 @@ public class OAuth2ResourceServerConfiguration {
...
@@ -106,9 +105,8 @@ public class OAuth2ResourceServerConfiguration {
public
static
class
ResourceServerFilterChainOrderProcessor
public
static
class
ResourceServerFilterChainOrderProcessor
implements
BeanPostProcessor
{
implements
BeanPostProcessor
{
private
ResourceServerProperties
resource
;
private
final
ResourceServerProperties
resource
;
@Autowired
public
ResourceServerFilterChainOrderProcessor
(
public
ResourceServerFilterChainOrderProcessor
(
ResourceServerProperties
resource
)
{
ResourceServerProperties
resource
)
{
this
.
resource
=
resource
;
this
.
resource
=
resource
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/resource/ResourceServerProperties.java
View file @
565f7543
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/OAuth2AutoConfigurationTests.java
View file @
565f7543
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
@@ -21,7 +21,6 @@ import java.util.Arrays;
...
@@ -21,7 +21,6 @@ import java.util.Arrays;
import
java.util.List
;
import
java.util.List
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
org.junit.Test
;
import
org.junit.Test
;
import
org.springframework.aop.support.AopUtils
;
import
org.springframework.aop.support.AopUtils
;
...
...
spring-boot-dependencies/pom.xml
View file @
565f7543
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.springframework.boot
</groupId>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-dependencies
</artifactId>
<artifactId>
spring-boot-dependencies
</artifactId>
...
@@ -2654,4 +2656,4 @@
...
@@ -2654,4 +2656,4 @@
<id>
integration-test
</id>
<id>
integration-test
</id>
</profile>
</profile>
</profiles>
</profiles>
</project>
</project>
\ No newline at end of file
spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
View file @
565f7543
...
@@ -454,6 +454,7 @@ content into your application; rather pick only the properties that you need.
...
@@ -454,6 +454,7 @@ content into your application; rather pick only the properties that you need.
security.oauth2.client.client-secret= # OAuth2 client secret. A random secret is generated by default
security.oauth2.client.client-secret= # OAuth2 client secret. A random secret is generated by default
# SECURITY OAUTH2 RESOURCES ({sc-spring-boot-autoconfigure}/security/oauth2/resource/ResourceServerProperties.{sc-ext}[ResourceServerProperties])
# SECURITY OAUTH2 RESOURCES ({sc-spring-boot-autoconfigure}/security/oauth2/resource/ResourceServerProperties.{sc-ext}[ResourceServerProperties])
security.oauth2.resource.filter-order= # The order of the filter chain used to authenticate tokens.
security.oauth2.resource.id= # Identifier of the resource.
security.oauth2.resource.id= # Identifier of the resource.
security.oauth2.resource.jwt.key-uri= # The URI of the JWT token. Can be set if the value is not available and the key is public.
security.oauth2.resource.jwt.key-uri= # The URI of the JWT token. Can be set if the value is not available and the key is public.
security.oauth2.resource.jwt.key-value= # The verification key of the JWT token. Can either be a symmetric secret or PEM-encoded RSA public key.
security.oauth2.resource.jwt.key-value= # The verification key of the JWT token. Can either be a symmetric secret or PEM-encoded RSA public key.
...
...
spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc
View file @
565f7543
...
@@ -2529,9 +2529,10 @@ needs to be running when your application starts up. It will log a warning if it
...
@@ -2529,9 +2529,10 @@ needs to be running when your application starts up. It will log a warning if it
find the key, and tell you what to do to fix it.
find the key, and tell you what to do to fix it.
OAuth2 resources are protected by a filter chain with order
OAuth2 resources are protected by a filter chain with order
`security.oauth2.resource.filter-order` and the default is after the
`security.oauth2.resource.filter-order` and the default is after the filter protecting the
filter protecting the actuator endpoints by default (so actuator
actuator endpoints by default (so actuator endpoints will stay on HTTP Basic unless you
endpoints will stay on HTTP Basic unless you change the order).
change the order).
[[boot-features-security-oauth2-token-type]]
[[boot-features-security-oauth2-token-type]]
...
...
spring-boot-samples/spring-boot-sample-secure-oauth2-actuator/src/test/java/sample/secure/oauth2/resource/SampleSecureOAuth2ResourceApplicationTests.java
View file @
565f7543
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
@@ -48,10 +48,10 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC
...
@@ -48,10 +48,10 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC
public
class
SampleSecureOAuth2ResourceApplicationTests
{
public
class
SampleSecureOAuth2ResourceApplicationTests
{
@Autowired
@Autowired
WebApplicationContext
context
;
private
WebApplicationContext
context
;
@Autowired
@Autowired
FilterChainProxy
filterChain
;
private
FilterChainProxy
filterChain
;
private
MockMvc
mvc
;
private
MockMvc
mvc
;
...
...
spring-boot-samples/spring-boot-sample-secure-oauth2-resource/pom.xml
View file @
565f7543
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<parent>
<parent>
<!-- Your own application should inherit from spring-boot-starter-parent -->
<!-- Your own application should inherit from spring-boot-starter-parent -->
...
...
spring-boot-samples/spring-boot-sample-secure-oauth2-resource/src/main/java/sample/secure/oauth2/resource/Flight.java
View file @
565f7543
/*
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot-samples/spring-boot-sample-secure-oauth2-resource/src/main/java/sample/secure/oauth2/resource/FlightRepository.java
View file @
565f7543
/*
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot-samples/spring-boot-sample-secure-oauth2-resource/src/main/java/sample/secure/oauth2/resource/SampleSecureOAuth2ResourceApplication.java
View file @
565f7543
/*
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
7
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.
...
...
spring-boot-samples/spring-boot-sample-secure-oauth2-resource/src/test/java/sample/secure/oauth2/resource/SampleSecureOAuth2ResourceApplicationTests.java
View file @
565f7543
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
@@ -40,16 +40,17 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC
...
@@ -40,16 +40,17 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC
* OAuth2-secured system
* OAuth2-secured system
*
*
* @author Greg Turnquist
* @author Greg Turnquist
* @author Dave Syer
*/
*/
@RunWith
(
SpringRunner
.
class
)
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
@SpringBootTest
(
webEnvironment
=
WebEnvironment
.
RANDOM_PORT
)
public
class
SampleSecureOAuth2ResourceApplicationTests
{
public
class
SampleSecureOAuth2ResourceApplicationTests
{
@Autowired
@Autowired
WebApplicationContext
context
;
private
WebApplicationContext
context
;
@Autowired
@Autowired
FilterChainProxy
filterChain
;
private
FilterChainProxy
filterChain
;
private
MockMvc
mvc
;
private
MockMvc
mvc
;
...
...
spring-boot-samples/spring-boot-sample-secure-oauth2/src/test/java/sample/secure/oauth2/SampleSecureOAuth2ApplicationTests.java
View file @
565f7543
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
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.
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
sample
.
secure
.
oauth2
;
package
sample
.
secure
.
oauth2
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -54,10 +55,10 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC
...
@@ -54,10 +55,10 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC
public
class
SampleSecureOAuth2ApplicationTests
{
public
class
SampleSecureOAuth2ApplicationTests
{
@Autowired
@Autowired
WebApplicationContext
context
;
private
WebApplicationContext
context
;
@Autowired
@Autowired
FilterChainProxy
filterChain
;
private
FilterChainProxy
filterChain
;
private
MockMvc
mvc
;
private
MockMvc
mvc
;
...
...
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