Repository navigation
Replies: 2 comments 9 replies
|
Hey @mshanah by any chance did you find to accomplish this? I'm about to dive into the code/docs but it is cheaper to ask :bad poker face: |
4 replies
|
Hi, i have faced with such problem. @Override
public AccessToken transformAccessToken(
AccessToken token,
ProtocolMapperModel mappingModel,
KeycloakSession keycloakSession,
UserSessionModel userSession,
ClientSessionContext clientSessionCtx) {
// 1. Do http request to your legacy application
// 2. Extract cookies from response
// 3. Attach those cookies to keycloak response
HttpResponse originalResponse = ResteasyProviderFactory.getInstance().getContextData(HttpResponse.class);
originalResponse.addNewCookie(new NewCookie(
"YOUR COOKIE KEY",
"YOUR COOKIE VALUE",
"/",
null,
null,
NewCookie.DEFAULT_MAX_AGE,
false,
true));
setClaim(token, mappingModel, userSession, keycloakSession, clientSessionCtx);
return token;
} |
5 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.
we have legacy Application that authenticate by validating specific cookie to table storing all the cookies with there expired time , how can i achieve same using keycloak? can i write custom code so after the user successfully logged in i set this cookie when the keycloak send the redirect URL?
All reactions