Problems with Keycloak URI redirection

2,761 views
Skip to first unread message

Julien

unread,
Mar 22, 2024, 2:52:30 AM3/22/24
to Keycloak User

I'm developing an application where the front-end communicates directly with Keycloak, and when the user is not logged in, I redirect them to the Keycloak login page. So far so good. However, I'm facing a problem. I can't get Keycloak to redirect the logged-in user to a specific address, which is located elsewhere. So, to provide context, here's what's happening:

The user accesses https://www.myapplication.com. If they're not logged in, they are redirected to https://mysecurity.keycloak.com/realms/myrealm/protocol/openid-connect/auth?client_id=account-console&redirect_uri=https://mysecurity.keycloak.com/realms/myrealm/account&state=xxxxx&response_mode=fragment&response_type=code&scope=openid&nonce=xxxxx&prompt=none&code_challenge=xxxxx&code_challenge_method=S256 where they log in. Note that the redirect_uri is set as the default path defined by Keycloak. If I go into the client settings and add the redirection URL https://www.myapplication.com/welcome to the "Valid redirect URIs" field, Keycloak presents me with the error "Invalid parameter: redirect_uri." Is it possible to achieve this with Keycloak? If so, how should I configure it?

Thank you.

valerie bauche

unread,
Mar 26, 2024, 11:51:52 AM3/26/24
to Keycloak User
Hi, 
This URL should be used to access the keycloak account console : client_id=account-console
I guess you configured a specific client for your application with a specific client_id so your URL should looks like :
Reply all
Reply to author
Forward
0 new messages