Required actions - Terms and Conditions - issue in redirecting user back to login page (browser specific)

My Keycloak version - 9.0.

I am enabling Terms and Conditions and also setting defaults to true. I have configured the t&c page the way I wanted and it is coming up when user put their credentials. Accepting the t&c works fine, it takes user to application.

But the issue is when user click on decline .
Ideally it should take user back to keycloak login page but it is taking user to application page with blank page and when you do a page refresh then it takes user back to Keycloak login page.

And surprisingly the issue is on Safari (13.1.1) and Google Chrome (87.0.4) and it is working fine on mozila Firefox (81.0), it takes user back to login page.

Here what I get in logs:
WARN [org.keycloak.events] (default task-3) type=CUSTOM_REQUIRED_ACTION_ERROR, realmId=, clientId=, userId=, ipAddress=, error=rejected_by_user, auth_method=openid-connect, custom_required_action=terms_and_conditions, response_type=code, redirect_uri=https://<domain_name>/, remember_me=false, code_id=<code_id>, response_mode=fragment, username=, authSessionParentId=fb55e9cf-fe78-41f7-bf04-ed4d5867d3f9, authSessionTabId=ecxUmJlMtoo

I am stuck on this, Please comment, suggest anything I am missing.
Any help is highly appreciated… Thanks.

1 Like

UPDATE to question as I can not edit:

I have checked on Mozilla Firefox where its working -
In Cookies I can see AUTH_SESSION_ID and KC_RESTART and when I click on decline, auth_session_id get replaced with OAuth_Token_Request_State and then again I can see AUTH_SESSION_ID and KC_RESTART are persisted when it redirects me to login page.

But this is not the case with Chrome and Safari… when I click on decline both the cookies get vanished and it takes me to application url instead of taking back to login page on keycloak.

Hi @vishmun : Can you please update if you got any solution/alternative for the same. I am also facing the same issue and will upvote this post.

Br,
Anubhav

@Anubhav I could not found the exact issue but I managed to do it.
I have added window.location.reload(); in my angular client when no authentication done (when user declines the T&C page)

1 Like