John Ruggentaler
@mattraible thanks the redirect URI was redirect_uri=http://localhost:8443/oauth2/okta/callback… but it needed to be redirect_uri=https://localhost:8443/oauth2/okta/callback… Next question, after I logged into Okta I was redirected to the Grails Spring Security default login page. According to the above article
After logging in, you’ll be redirected back to your Grails app, where you’ll see the screen that allows you to either register a new account or link your OAuth account to an existing user account.
but I am seeing the default Grails Login page and the URL is https://localhost:8443/oauth2/okta/callback?state=okta-secret-<#####>&error=access_denied&error_description=Policy+evaluation+failed+for+this+request%2C+please+check+the+policy+configurations. How should I check the policy for my user? FYI, I created the user I logged in with in or Okta staging/preview environment as we are currently using Okta and I am trying to migrate our Grails apps to authenticate using Okta.
I enabled logging and after I logged into Okta I see the following message in the log:
2021-06-10 11:19:01.513 ERROR — [nio-8443-exec-5] o.g.web.errors.GrailsExceptionResolver : OAuth2Exception occurred when processing request: [GET] /oauth2/okta/callback - parameters:
state: okta-secret-######
error: access_denied
error_description: Policy evaluation failed for this request, please check the policy configurations.
No AuthCode in callback for provider ‘okta’. Stacktrace follows: