keycloak-spring-cloud-gateway-and-resource-server
keycloak-spring-cloud-gateway-and-resource-server copied to clipboard
gateway cannot handle /authorized url after I change keycloak to spring authorization server
Hello, I followed your tutorial and everything worked well.
I'd just like to replace keycloak with the new spring authorization server so that I can do more customization.
However I cannot get the job done.
- Trying to access the resource server(api) via gateway, gateway redirect me to IdP(spring authorization server)
- Login in successfully and agree on the consent page
- After that, the gateway cannot process the redirect uri
http://127.0.0.1:8080/authorized?code=!
Looks like OAuth2AuthorizationCodeGrantWebFilter in the spring cloud gateway not work, it cannot understand the callback url.
Do you have any working Spring Authorization Server + Spring Cloud Gateway(as oauth2 client) example. Thank you very much.
Hey @uniquejava ,
I think the redirect URL has to be of this format "{baseUrl}/{action}/oauth2/code/{registrationId}";
you can have a look at this class here: CommonOAuth2Provider.
Try changing it. see if works.
I haven't used spring authorization server.. So not sure about this.