Java Code Examples for org.keycloak.services.managers.AuthenticationManager#getRealmCookiePath()

The following examples show how to use org.keycloak.services.managers.AuthenticationManager#getRealmCookiePath() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RestartLoginCookie.java    From keycloak with Apache License 2.0 5 votes vote down vote up
public static void setRestartCookie(KeycloakSession session, RealmModel realm, ClientConnection connection, UriInfo uriInfo, AuthenticationSessionModel authSession) {
    RestartLoginCookie restart = new RestartLoginCookie(authSession);
    String encoded = session.tokens().encode(restart);
    String path = AuthenticationManager.getRealmCookiePath(realm, uriInfo);
    boolean secureOnly = realm.getSslRequired().isRequired(connection);
    CookieHelper.addCookie(KC_RESTART, encoded, path, null, null, -1, secureOnly, true);
}
 
Example 2
Source File: RestartLoginCookie.java    From keycloak with Apache License 2.0 4 votes vote down vote up
public static void expireRestartCookie(RealmModel realm, ClientConnection connection, UriInfo uriInfo) {
    String path = AuthenticationManager.getRealmCookiePath(realm, uriInfo);
    boolean secureOnly = realm.getSslRequired().isRequired(connection);
    CookieHelper.addCookie(KC_RESTART, "", path, null, null, 0, secureOnly, true);
}