spring-projects / spring-authorization-server

Spring Authorization Server
https://spring.io/projects/spring-authorization-server
Apache License 2.0
4.84k stars 1.28k forks source link

Keycloak Integration With Spring Authorization Server #1301

Closed majumdarp closed 1 year ago

majumdarp commented 1 year ago

Describe the bug I am working on a use case where I need to have keycloak integrated as an Identity Broker to a service based on Spring Authorization Server (Spring Boot).I get errors on testing the connection in postman.

To Reproduce

Scenario 1-Spring Authorization Server (0.2.0) /Spring Boot 2.5.4 with Keycloak 15.0.2 1)On submitting request on postman(using Oauth2 Authorization -client details (entered in Keycloak),token and authorize endpoints,redirect uri,request redirects to keyclaok login screen. 2)Using 'sign in using OIDC' (OIDC stands for the Spring Authorization Server Project deployed locally),get the login page served by the project. 3)Login results in successful authentication ,but redirect back to keycloak throws a Whitelabel error on the browser ,no token submittted back to postman.

Scenario 2-Spring Authorization Server(1.1.1)/Spring Boot 3.1.1 with Keycloak 15.0.2 1)Same request with same request posted on postman.This tome the OIDC login from keyclaok throws a 400 error code on the browser.

Expected behavior The access token returned by the Spring Authorization Server project should be returned back to keycloak, which then redirects it back successfully to postman.

majumdarp commented 1 year ago

Application Properties.txt Pom

SecurityConfig2.txt SecurityConfig1.txt

sjohnr commented 1 year ago

@majumdarp, thanks for reaching out. Please note that it is not necessary to cross-post your question as we regularly monitor stackoverflow. I have asked for additional information on your question and we can continue the conversation there.