Spring Security oauth2 - перенаправление на localhost / {param}? Code = *************** & state = **** - PullRequest
0 голосов
/ 03 августа 2020

У меня есть веб-приложение, использующее весеннюю загрузку версии 2.1.8, реализующее oauth2 с единой регистрацией. Это мой класс SecurityConfiguration

@EnableOAuth2Sso
@EnableWebSecurity
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {

  @Override
  protected void configure(HttpSecurity http) throws Exception {

    http.requiresChannel().anyRequest().requiresSecure().and().antMatcher("/**").authorizeRequests()
        .antMatchers("/", "/login**", `enter code here`"/callback/", "/webjars/**", "/error**").permitAll()
        .antMatchers("/admin").hasRole("some-role")
        .antMatchers("/employees").hasRole("some-other-role").anyRequest().authenticated();

  }

, как только я успешно вхожу в систему с нашим sso, он перенаправляет меня на localhost / {myUrl}? Code = ** & state =

У меня они указаны в моей конфигурации

 security.oauth2.client.client-id=
security.oauth2.client.client-secret=
security.oauth2.client.access-token-uri=
security.oauth2.client.user-authorization-uri=


security.oauth2.class.scope=
security.oauth2.resource.user-info-uri=
security.oauth2.client.preEstablishedRedirectUri=
security.oauth2.client.use-current-uri=

зависимости, которые я использую, это

 <dependency>
      <groupId>org.springframework.security.oauth.boot</groupId>
      <artifactId>spring-security-oauth2-autoconfigure</artifactId>
      <version>2.1.9.RELEASE</version>
    </dependency>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-security</artifactId>
    </dependency>

Кто-нибудь знает, почему это перенаправление с кодом в URL-адресе и как решить эту проблему?

...