Repository navigation
Replies: 1 comment
|
Currently, i'm also struggling with this issue. There is a lack of documentation or example on how to switch the session. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Dear Everyone!
I make this question too in wildfly forum but haven't got any answer yet, so that's why I'm asking here.
I would like to implement impersonation feature with token exchange in my jakarta ee backend application with wildfly.
My setup using the new Wildfly Elytron security subsystem the security domain was setted in standalone.xml, oidc.json setted inside the war application.
When I open the app in the browser it's redirecting me to keycloak login screen to auth when it's succeed the app is redirected to the corresponding URL, everything is working fine.
I would like to implement the impersonation so I wrote the token exchange it's works well got back the 200 OK with the json including access_token, refresh_token, expires_in fields, but I'm stuck here. I don't understand how can I change the current user session to the new one in wildfly and browser. I tried this but not working:
When I'm using createRunAsIdentity with authorize=true it's throwing an exception:
when authorize=false there is no exception thrown but when refreshing the page the same user logged in.
Tried to expire the cookies (AUTH_SESSION_ID, AUTH_SESSION_ID_LEGACY, KEYCLOAK_IDENTITY, KEYCLOAK_IDENTITY_LEGACY, KEYCLOAK_LOCALE, KEYCLOAK_REMEMBER_ME, KEYCLOAK_SESSION, KEYCLOAK_SESSION_LEGACY) too after this api call returns, but not solved the problem.
Also tried to logout first then call the api still not solved the problem.
Thanks for any help!
All reactions