5

Facing issue with Keycloak login when trying to access it using iFrame. I am getting following error:

2020-08-29 04:06:50,976 WARN  [org.keycloak.events] (default task-9654) type=LOGIN_ERROR, realmId=34d62e4f-f267-4f1a-8ec7-075e5046543b, clientId=null, userId=null, ipAddress=192.168.66.183, error=invalid_code

Its working fine when trying to access it via chrome browser,

2020-08-29 04:08:44,310 INFO  [org.keycloak.events] (default task-9658) type=LOGIN, realmId=34d62e4f-f267-4f1a-8ec7-075e5046543b, clientId=dxp-frontend, userId=6db38019-c323-4071-abc2-a39c705ed122, ipAddress=192.168.66.183, auth_method=openid-connect, auth_type=code, redirect_uri=https://dxp-model1.devopnet.in.telstra.com.au/csrtb/, consent=no_consent_required, code_id=ac77dc9d-9237-4c17-b74d-9f3c9582ebbd, username=dxpcsr1, authSessionParentId=ac77dc9d-9237-4c17-b74d-9f3c9582ebbd, authSessionTabId=3K3KgKVc2bc
2020-08-29 04:08:45,811 INFO  [org.keycloak.events] (default task-9658) type=CODE_TO_TOKEN, realmId=34d62e4f-f267-4f1a-8ec7-075e5046543b, clientId=dxp-frontend, userId=6db38019-c323-4071-abc2-a39c705ed122, ipAddress=192.168.66.183, token_id=15905d22-c77f-4f6d-bce4-63c36ed04f0b, grant_type=authorization_code, refresh_token_type=Refresh, scope='openid profile email', refresh_token_id=a0b3437b-c2b3-4179-ad24-833459a847db, code_id=ac77dc9d-9237-4c17-b74d-9f3c9582ebbd, client_auth_method=client-secret

Additional Information

Using K8 cluster where a single instance of Keycloak is deployed.

Dharman
  • 30,962
  • 25
  • 85
  • 135
  • Which browser gives the error? Also after logging in, in your keycloak object, do you still see the access_token and refresh_token or they are disappeared from the object? – Ziko Aug 30 '20 at 21:11
  • I am getting the exact same issue running tests in cypress (effectively an iframe). The browser used under the hood is Chrome. In my case there's no token at all as the authentication flow isn't completed and redirection back to the site does not happen. @Ziko – José Carlos Dec 02 '20 at 11:32
  • Has this been resolved by somebody? – Jan Oct 28 '22 at 12:34

0 Answers0