Ответ токена доступа: ошибка при извлечении ответа для типаJAVA

Программисты JAVA общаются здесь
Ответить Пред. темаСлед. тема
Anonymous
 Ответ токена доступа: ошибка при извлечении ответа для типа

Сообщение Anonymous »

Я получаю сообщение об ошибке ниже после входа в приложение Springboot с помощью azure ad-b2c.

Код: Выделить всё

[invalid_token_response] An error occurred while attempting to retrieve the OAuth 2.0
Access Token Response: Error while extracting response for type [class org.springframework.security.oauth2.core.endpoint.OAuth2AccessTokenResponse]
and content type [application/json;charset=utf-8]
Вот мои свойства application.properties

Код: Выделить всё

spring.application.name=azure B2C SSO Sample

logging.level.org.springframework.security.oauth2=DEBUG

spring.security.oauth2.client.registration.azuread-b2c.client-id=d9353b2a-a3c1-49c2-9252-7xxxxx
spring.security.oauth2.client.registration.azuread-b2c.client-secret=Idv8Q~BL1GRyirEaO-AXDaSQgFwJ1Rxxxxx

spring.security.oauth2.client.registration.azuread-b2c.scope=openid,profile

spring.security.oauth2.client.registration.azuread-b2c.redirect-uri=http://localhost:8080/login/oauth2/code/azure
spring.security.oauth2.client.registration.azuread-b2c.authorization-grant-type=authorization_code
spring.security.oauth2.client.registration.azuread-b2c.client-authentication-method=client_secret_post
spring.security.oauth2.client.provider.azuread-b2c.authorization-uri=https://learningakash.b2clogin.com/learningakash.onmicrosoft.com/b2c_1_signupsignin/oauth2/v2.0/authorize
spring.security.oauth2.client.provider.azuread-b2c.token-uri=https://learningakash.b2clogin.com/learningakash.onmicrosoft.com/b2c_1_signupsignin/oauth2/v2.0/token

spring.security.oauth2.client.provider.azuread-b2c.jwk-set-uri=https://learningakash.b2clogin.com/learningakash.onmicrosoft.com/discovery/v2.0/keys?p=B2C_1_signupsignin

Моя конфигурация безопасности.java

Код: Выделить всё

package config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.web.SecurityFilterChain;

@Configuration
@EnableWebSecurity
public class SecurityConfig {

@Bean
public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
http
.authorizeHttpRequests(authorize -> authorize
.anyRequest().authenticated() // Secure all requests
)
.oauth2Login(oauth2 -> oauth2 // Configure OAuth2 Login
.authorizationEndpoint(authorization ->
authorization.baseUri("/oauth2/authorize")) // Customize the authorization endpoint
.redirectionEndpoint(redirection ->
redirection.baseUri("/login/oauth2/code/*")) // Customize the redirection endpoint
)
.logout(logout ->
logout.logoutSuccessUrl("/").permitAll() // Redirect to home on logout
);

return http.build(); // Return the built HttpSecurity
}
}
Нужно ли мне создавать отдельную функцию контроллера, которая обрабатывает вызовы после входа в систему?
Я что-то здесь упустил, что не так

Подробнее здесь: https://stackoverflow.com/questions/790 ... e-for-type
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «JAVA»