congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
OIDCFilterSessionStore.cleanSession
Code IndexAdd Tabnine to your IDE (free)

How to use
cleanSession
method
in
org.keycloak.adapters.servlet.OIDCFilterSessionStore

Best Java code snippets using org.keycloak.adapters.servlet.OIDCFilterSessionStore.cleanSession (Showing top 3 results out of 315)

origin: org.keycloak/keycloak-servlet-filter-adapter

@Override
public void logout() {
  HttpSession httpSession = request.getSession(false);
  if (httpSession != null) {
    SerializableKeycloakAccount account = (SerializableKeycloakAccount) httpSession.getAttribute(KeycloakAccount.class.getName());
    if (account != null) {
      account.getKeycloakSecurityContext().logout(deployment);
    }
    cleanSession(httpSession);
  }
}
origin: org.keycloak/keycloak-servlet-filter-adapter

@Override
public boolean isCached(RequestAuthenticator authenticator) {
  HttpSession httpSession = request.getSession(false);
  if (httpSession == null) return false;
  SerializableKeycloakAccount account = (SerializableKeycloakAccount) httpSession.getAttribute(KeycloakAccount.class.getName());
  if (account == null) {
    return false;
  }
  log.fine("remote logged in already. Establish state from session");
  RefreshableKeycloakSecurityContext securityContext = account.getKeycloakSecurityContext();
  if (!deployment.getRealm().equals(securityContext.getRealm())) {
    log.fine("Account from cookie is from a different realm than for the request.");
    cleanSession(httpSession);
    return false;
  }
  if (idMapper != null && !idMapper.hasSession(httpSession.getId())) {
    log.fine("idMapper does not have session: " + httpSession.getId());
    //System.err.println("idMapper does not have session: " + httpSession.getId());
    cleanSession(httpSession);
    return false;
  }
  securityContext.setCurrentRequestInfo(deployment, this);
  request.setAttribute(KeycloakSecurityContext.class.getName(), securityContext);
  needRequestRestore = restoreRequest();
  return true;
}
origin: org.keycloak/keycloak-servlet-filter-adapter

@Override
public void checkCurrentToken() {
  HttpSession httpSession = request.getSession(false);
  if (httpSession == null) return;
  SerializableKeycloakAccount account = (SerializableKeycloakAccount)httpSession.getAttribute(KeycloakAccount.class.getName());
  if (account == null) {
    return;
  }
  RefreshableKeycloakSecurityContext session = account.getKeycloakSecurityContext();
  if (session == null) return;
  // just in case session got serialized
  if (session.getDeployment() == null) session.setCurrentRequestInfo(deployment, this);
  if (session.isActive() && !session.getDeployment().isAlwaysRefreshToken()) return;
  // FYI: A refresh requires same scope, so same roles will be set.  Otherwise, refresh will fail and token will
  // not be updated
  boolean success = session.refreshExpiredToken(false);
  if (success && session.isActive()) return;
  // Refresh failed, so user is already logged out from keycloak. Cleanup and expire our session
  //log.fine("Cleanup and expire session " + httpSession.getId() + " after failed refresh");
  cleanSession(httpSession);
  httpSession.invalidate();
}
org.keycloak.adapters.servletOIDCFilterSessionStorecleanSession

Popular methods of OIDCFilterSessionStore

  • <init>
  • checkCurrentToken
  • buildWrapper
  • clearSavedRequest
  • logout
  • restoreRequest

Popular in Java

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • putExtra (Intent)
  • setScale (BigDecimal)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • JComboBox (javax.swing)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now