Baeldung / spring-security-oauth

Getting Started withg Spring Security OAuth:
http://bit.ly/github-lsso
MIT License
1.99k stars 1.95k forks source link

After login, not able to redirect to client server and exchange auth Code with access token #559

Open ritika861 opened 6 days ago

ritika861 commented 6 days ago

I am following https://www.baeldung.com/spring-security-oauth-auth-server Post for implementing Auth server, resource server, client server implementation. I am getting auth code in return when login with the user/ password mentioned in config. But it's not able to redirect to client server with the URL http://127.0.0.1:8080/login/oauth2/code/articles-client-oidc?code = "alphanumericCode" (I am able to see this url is getting generated in Network tab of the browser tool)

Looks like user is not logged in also but it redirects to /login?error. Still it redirects to the url mentioned in redirect uri in configuration and generates the auth code.

Any help is highly appreciated. thanks in advance.

Tried on local system. But not able to generate access token. It should have generated as per from the documentation.

ritika861 commented 6 days ago

This is regarding this application from the given list "oauth-authorization-server"

ulisseslima commented 6 days ago

Hey, @ritika861.

Can you clarify if you're using the code from the repository without modifications when following the steps described here?

If so, you should get this response from http://127.0.0.1:8080/articles after login:

["Article 1","Article 2","Article 3"]