Hello ,
we are using keycloak for our nextjs webapp authentication.
If I run in localhost, its redirects perfectly, but when we deploy it to the server
1.It redirects to keycloak login page perfectly
2. After login ,it redirects to http://localhost:3000/api/auth/callback/keycloak… instead of webapp home page
.env file
KEYCLOAK_ID=OurFrontEndClient
KEYCLOAK_SECRET=**************************
KEYCLOAK_ISSUER=ourkeycloackclient
NEXTAUTH_URL=
NEXTAUTH_SECRET=*****************************
Keycloak setting
Base URLBase URL :https://ourdomain.in/
Valid Redirect URIs : . (works fine)
When Valid Redirect URIs is set to ourdomain.in/ , “Invalid parameter: redirect_uri” error occurs and no login page appears
Why and where is it redirecting to localhost??
Any idea how to avoid redirects to localhost and redirect_uri error ?
[next-auth][error][CALLBACK_OAUTH_ERROR]