PHP - The 'redirect_uri' parameter must be a Login redirect URI in the client app settings

I’m getting 400 error - Error: The ‘redirect_uri’ parameter must be a Login redirect URI in the client app settings - on Okta OAuth2/OIDC with my PHP application. I followed the Quickstart PHP code and made the application Login settings as per Quickstart.

.env
OKTA_OAUTH2_ISSUER=“https://dev-13205505.okta.com/oauth2/default
OKTA_OAUTH2_CLIENT_ID=“My Client ID”
OKTA_OAUTH2_CLIENT_SECRET=“My Client Secret”

/public/index.php

Hi Denis - thanks for the post.

The “Login redirect URI” (from the error message) and the “Sign-in redirect URIs” (in the UI) refer to the same thing. You must have your URI entered in to the “Sign-in redirect URIs” for the app settings.

See Create OIDC app integrations using AIW | Okta (task 2 in Sign-in redirect URIs)

Can you send me a sample PHP code snippet?

Should the “Sign-in redirect URIs” be the authenticated page of my application or the authorization-code/callback page?

When I try to authenticate in Okta

Can someone help me?

Add the value for the redirect_uri parameter in your /authorize request as a “Sign-in redirect URI” registered for the application (client) you created in Okta, as discussed in this guide: 400 Bad Request; The ‘redirect_uri’ parameter must be a Login redirect URI in the client app settings | Okta Help Center