Я следую инструкциям , описанным в этом видео , при попытке включить Spring OAuth 2.0 провайдер аутентификации Google.
Мое локальное приложение Spring Boot открывается через Serveo :
ssh -R 80:localhost:9090 serveo.net
Forwarding HTTP traffic from https://liber.serveo.net
Press g to start a GUI session and ctrl-c to quit.
Вот application.yml:
server:
port: 9090
logging:
level:
root: INFO
org.springframework.web: INFO
org.springframework.security: INFO
spring:
thymeleaf:
cache: false
security:
oauth2:
client:
registration:
google:
client-id: 674747800332-16ib5p71[...]9onirqi4je1iq.apps.googleusercontent.com
client-secret: yOLg4xIxe[...]rjU-
client-authentication-method: basic
authorization-grant-type: authorization_code
#redirect-uri-template: "{baseUrl}/login/oauth2/code/{registrationId}"
redirect-uri-template: https://liber.serveo.net/login/oauth2/code/google
scope: openid, profile, email
client-name: Google
provider:
google:
authorization-uri: https://accounts.google.com/o/oauth2/v2/auth
token-uri: https://googleapis.com/oauth2/v4/token
user-info-uri: https://googleapis.com/oauth2/v3/userinfo
user-name-attribute: sub
jwk-set-uri: https://googleapis.com/oauth2/v3/certs
Приведенная выше настройка приводит к следующему потоку:
1.
![enter image description here](https://i.stack.imgur.com/JyW6D.png)
2.
![enter image description here](https://i.stack.imgur.com/e3qDa.png)
, что в итоге не удаетсяследует в соответствии с приведенными выше инструкциями:
3.
![enter image description here](https://i.stack.imgur.com/6W97V.png)
Аналогичные результаты достигаются, если я получаю доступ к первоначальному заявлению в http://localhost:9090
Учетные данные Google правильно настроены для перенаправления на:
https://liber.serveo.net/login/oauth2/code/google
, которое, судя по сообщениям об ошибках и журналам, похоже, не используется Spring.
Как можно отладить код платформы Spring, который самостоятельно генерирует страницу входа, чтобы увидеть, как формулируется запрос и какие параметры могут вызывать проблему?Задокументировано ли где-нибудь API Google для этого вызова по ошибке?Где Spring получает значение для переменной {baseUrl}
в своей конфигурации?