Merge pull request #3896 from thomasdarimont/issue/KEYCLOAK-4505-expose-clientSession-binding-to-ScriptBasedAuthenticator

KEYCLOAK-4505 Expose current clientSession binding to ScriptBasedAuthenticator
This commit is contained in:
Marek Posolda 2017-03-01 12:17:29 +01:00 committed by GitHub
commit 4f4ae44a16
2 changed files with 3 additions and 0 deletions

View file

@ -47,6 +47,7 @@ import java.util.Map;
* <li>{@code realm} the {@link RealmModel}</li> * <li>{@code realm} the {@link RealmModel}</li>
* <li>{@code user} the current {@link UserModel}</li> * <li>{@code user} the current {@link UserModel}</li>
* <li>{@code session} the active {@link KeycloakSession}</li> * <li>{@code session} the active {@link KeycloakSession}</li>
* <li>{@code clientSession} the current {@link org.keycloak.models.ClientSessionModel}</li>
* <li>{@code httpRequest} the current {@link org.jboss.resteasy.spi.HttpRequest}</li> * <li>{@code httpRequest} the current {@link org.jboss.resteasy.spi.HttpRequest}</li>
* <li>{@code LOG} a {@link org.jboss.logging.Logger} scoped to {@link ScriptBasedAuthenticator}/li> * <li>{@code LOG} a {@link org.jboss.logging.Logger} scoped to {@link ScriptBasedAuthenticator}/li>
* </ol> * </ol>
@ -159,6 +160,7 @@ public class ScriptBasedAuthenticator implements Authenticator {
bindings.put("user", context.getUser()); bindings.put("user", context.getUser());
bindings.put("session", context.getSession()); bindings.put("session", context.getSession());
bindings.put("httpRequest", context.getHttpRequest()); bindings.put("httpRequest", context.getHttpRequest());
bindings.put("clientSession", context.getClientSession());
bindings.put("LOG", LOGGER); bindings.put("LOG", LOGGER);
}); });
} }

View file

@ -15,6 +15,7 @@ AuthenticationFlowError = Java.type("org.keycloak.authentication.AuthenticationF
* session - current KeycloakSession {@see org.keycloak.models.KeycloakSession} * session - current KeycloakSession {@see org.keycloak.models.KeycloakSession}
* httpRequest - current HttpRequest {@see org.jboss.resteasy.spi.HttpRequest} * httpRequest - current HttpRequest {@see org.jboss.resteasy.spi.HttpRequest}
* script - current script {@see org.keycloak.models.ScriptModel} * script - current script {@see org.keycloak.models.ScriptModel}
* clientSession - current client session {@see org.keycloak.models.ClientSessionModel}
* LOG - current logger {@see org.jboss.logging.Logger} * LOG - current logger {@see org.jboss.logging.Logger}
* *
* You one can extract current http request headers via: * You one can extract current http request headers via: