mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
User can enable OAuth2 SSO by declaring the intent (@EnableOAuth2Sso) and also configuring the client properties (spring.oauth2.client.*). The spring.oauth2.sso.* are only needed to change the path for the login (defaults to /login) - any other security configuration for the protected resources can be added in a WebSecurityConfigurerAdapter which carries the @EnableOAuth2Sso annotation.
14 lines
180 B
Groovy
14 lines
180 B
Groovy
package org.test
|
|
|
|
@EnableAuthorizationServer
|
|
@EnableResourceServer
|
|
@RestController
|
|
class SampleController {
|
|
|
|
@RequestMapping("/")
|
|
def hello() {
|
|
[message: "Hello World!"]
|
|
}
|
|
|
|
}
|