Help with login

I’m currently evaluating using Okta and I’m experiencing an issue where when I attempt to log in the browser displays the message

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’m using NodeJS and I’m trying to change the callback route to go to /admin. The code I’m using for the callback is

const oidc = new ExpressOIDC({
issuer: {my okta domain}/oauth2/default,
client_id: {client id},
client_secret: {client secret},
appBaseUrl: {base url},
routes: {
loginCallback: {
path: ‘/admin’
}
}
});

Is there something additional I need to do to allow the callback to go to /admin? Sorry if it is a very basic question but I’m very new to all this.

Many Thanks

You might need to define a redirect uri in your OIDC app you created in Okta and make sure it matches what you have in the ExpressOIDC. If you already done that, then make sure you add that url to the whitelist CORS/Redirect uris in Okta. Navigate to Security > API > Trusted Origins

Hi @Talib

Please make sure to add the redirect_uri present on /authorize endpoint in Okta also in the OIDC app in Okta under Admin >> Applications >> your OIDC application >> General >> Login Redirect URIs.

@afalahi and @dragos thank you both for your replies. I think I’ve got it working now. Thanks again