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.