Sam*_*nta 0 java spring spring-boot spring-security-oauth2
目前,我使用的是 Spring Boot 2.2.5 Release。文档看起来不完整。@EnableOAuth2Client
或的替代品是什么@EnableOAuth2Sso
。在此处输入图片说明
您可以通过WebSecurityConfigurerAdapter 的configure 方法而不是注释来实现。
EnableOAuth2Sso 现在是这样的:
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.anyRequest().authenticated()
.and()
.oauth2Login(); // sso
}
Run Code Online (Sandbox Code Playgroud)@EnableOAuth2Client 现在是这样(有关完整示例和配置选项,请参阅 Spring 的迁移指南):
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.oauth2Client();
}
Run Code Online (Sandbox Code Playgroud) 归档时间: |
|
查看次数: |
1991 次 |
最近记录: |