I am setting up OKTA with my Spring Boot Application 2.1.x. I built it following one of your examples. Got it work as expected. When I try to change the Audience section within the Authorization Server from api://default to client Id (My companies default), I get a 400 error stating
Identity Provider: Unknown
Error Code: invalid_request
Description: The ‘redirect_uri’ parameter must be an absolute URI that is whitelisted in the client app settings.
I have searched up and down the forums looking to why this happening but I cant find anything.
Here is my call in the controller @RequestMapping(value = { “/loginuser” }, method = RequestMethod.GET)
public String loginuser(@AuthenticationPrincipal OidcUser user, Model model, HttpServletRequest request) {
String email = user.getEmail();
The error that you mentioned is caused by the redirect_uri query parameter in the url not being also added in Okta under Admin >> Applications >> your OIDC app >> General >> Login Redirect URIs.
Can you please add the URL and let us know how it goes?
Can you please check under Security >> API (or directly API if using Developer Admin Console) >> Authorization Servers >> your authorization server >> Access Policies if you have a custom policy and rule for your OIDC application and OIDC flow used?
“Polices are evaluated in priority order, as are the rules in a policy. The first policy and rule that matches the client request is applied and no further rule or policy processing occurs. If a client matches no policies, the authentication attempt fails and an error is returned.”
Can you please copy the redirect_uri that you have set as query parameter in the link to /authorize endpoint and add it inside the OIDC app in Okta under Admin >> Applications >> OIDC app >> General >> Login Redirect URI?