Безопасность Spring Boot Starter
Клиент oauth2 Spring Boot Starter
application.properties:
Код: Выделить всё
spring.security.oauth2.client.registration.qwerty=qwerty
spring.security.oauth2.client.registration.qwerty.client-id=qwe
spring.security.oauth2.client.registration.qwerty.redirect-uri=http://qwe.com:9090/welcome/callback
spring.security.oauth2.client.registration.qwerty.scope=openid
spring.security.oauth2.client.registration.qwerty.authorization-grant-type=authorization_code
spring.security.oauth2.client.provider.qwerty.issuer-uri=https://qwerty.com
spring.security.oauth2.client.provider.qwerty.authorization-uri=https://qwerty.com/as/authorization.oauth2
spring.security.oauth2.client.provider.qwerty.token-uri=https://qwerty.com/as/token.oauth2
Код: Выделить всё
@Configuration
@EnableWebSecurity
public class WebSecurityConfig {
@Bean
public SecurityFilterChain securityFilterChain(HTTPSecurity http) throws Exception{
http.csrf().disable()
.authorizaHttpRequests()
.anyRequest().authenticated()
.and()
.oauth2Login()
.redirectionEndpoint()
.baseUri("/callback");
return http.build();
}
}
предположим, что
конечная точка: http://qwe:9090/welcome/name
if Я открываю эту конечную точку выше в браузере, и она возвращает имя
но если я попытаюсь подключиться к этой конечной точке в Postman, он говорит: 401 не авторизован
как добраться до указанной выше конечной точки в Postman, если у меня есть указанная выше конфигурация безопасности в моем приложение?
сервер авторизации использует Kerberos для аутентификации.
Подробнее здесь: https://stackoverflow.com/questions/787 ... omnia-gett