Spring Boot 2.0.3 oauth2身份验证

时间:2018-07-14 01:41:06

标签: spring spring-boot spring-security spring-security-oauth2 spring-webflux

我有以下配置

compile group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: '2.0.3.RELEASE'
compile group: 'org.springframework.boot', name: 'spring-boot-starter-webflux', version: '2.0.3.RELEASE'
runtime('org.springframework.boot:spring-boot-devtools')
compile group: 'org.springframework.security', name: 'spring-security-config', version: '5.0.6.RELEASE'
compile group: 'org.springframework.security', name: 'spring-security-oauth2-client', version: '5.0.6.RELEASE'
compile group: 'org.springframework.security', name: 'spring-security-oauth2-jose', version: '5.0.6.RELEASE'

一个简单的sprint引导应用程序

@SpringBootApplication
public class App{

    public static void main(String[] args) {
        SpringApplication.run(App.class, args);
    }
}

和客户端配置

spring.security.oauth2.client.registration.google.client-id=x
spring.security.oauth2.client.registration.google.client-secret=y
spring.security.oauth2.client.registration.facebook.client-id=x
spring.security.oauth2.client.registration.facebook.client-secret=y

在检查了一些资源和春季安全性oauth2 docs https://docs.spring.io/spring-security/site/docs/current/reference/html5/#jc-oauth2login之后,我希望所有这些代码都可以将应用程序配置为具有@EnableWebFluxSecurity的@EnableWebFlux,并将使用属性文件中提供的客户端来配置默认ClientRepository 。

他们说,当您访问您的应用程序时,您将获得一个列表,其中包含您添加的客户。相反,我收到了基本的身份验证机制。知道发生了什么还是我做错了什么?

0 个答案:

没有答案