I have configured the client app for authorization code grant flow. I am using the redirect-uri to http://localhost:8555/login/oauth2/code/okta
which is what Spring Security uses to intercept and fetch the access token.
I tried changing the redirect uri to http://localhost:8555/callback and edited the config in application config like below, but there are too many redirects and the token is not retrieved. Where am I going wrong?
spring:
security:
oauth2:
client:
registration:
custom:
clientId: confidential
clientSecret: confidential
redirectUri: http://localhost:8555/callback
scope: openid,email,offline_access
provider: custom-provider
provider:
custom-provider:
authorizationUri: https://dev-7858070.okta.com/oauth2/default/v1/authorize
tokenUri: https://dev-7858070.okta.com/oauth2/default/v1/token