Tabnine Logo
SamlSessionStore
Code IndexAdd Tabnine to your IDE (free)

How to use
SamlSessionStore
in
org.keycloak.adapters.saml

Best Java code snippets using org.keycloak.adapters.saml.SamlSessionStore (Showing top 9 results out of 315)

origin: org.keycloak/keycloak-saml-adapter-core

protected AuthOutcome handleLogoutResponse(SAMLDocumentHolder holder, StatusResponseType responseType, String relayState) {
  boolean loggedIn = sessionStore.isLoggedIn();
  if (!loggedIn || !"logout".equals(relayState)) {
    return AuthOutcome.NOT_ATTEMPTED;
  }
  sessionStore.logoutAccount();
  return AuthOutcome.LOGGED_OUT;
}
origin: org.keycloak/keycloak-saml-adapter-core

@Override
public boolean challenge(HttpFacade httpFacade) {
  try {
    SAML2AuthnRequestBuilder authnRequestBuilder = buildSaml2AuthnRequestBuilder(deployment);
    BaseSAML2BindingBuilder binding = createSaml2Binding(deployment);
    sessionStore.saveRequest();
    sendAuthnRequest(httpFacade, authnRequestBuilder, binding);
    sessionStore.setCurrentAction(SamlSessionStore.CurrentAction.LOGGING_IN);
  } catch (Exception e) {
    throw new RuntimeException("Could not create authentication request.", e);
  }
  return true;
}
origin: org.keycloak/keycloak-saml-adapter-core

  sessionStore.setCurrentAction(SamlSessionStore.CurrentAction.NONE);
if (sessionStore.isLoggingOut()) {
  try {
    if (deployment.getIDP().getSingleLogoutService().validateResponseSignature()) {
    sessionStore.setCurrentAction(SamlSessionStore.CurrentAction.NONE);
} else if (sessionStore.isLoggingIn()) {
    return AuthOutcome.FAILED;
  } finally {
    sessionStore.setCurrentAction(SamlSessionStore.CurrentAction.NONE);
origin: org.keycloak/keycloak-saml-tomcat-adapter-core

@Override
public void invoke(Request request, Response response) throws IOException, ServletException {
  log.trace("*********************** SAML ************");
  CatalinaHttpFacade facade = new CatalinaHttpFacade(response, request);
  SamlDeployment deployment = deploymentContext.resolveDeployment(facade);
  if (request.getRequestURI().substring(request.getContextPath().length()).endsWith("/saml")) {
    if (deployment != null && deployment.isConfigured()) {
      SamlSessionStore tokenStore = getSessionStore(request, facade, deployment);
      SamlAuthenticator authenticator = new CatalinaSamlEndpoint(facade, deployment, tokenStore);
      executeAuthenticator(request, response, facade, deployment, authenticator);
      return;
    }
  }
  try {
    getSessionStore(request, facade, deployment).isLoggedIn();  // sets request UserPrincipal if logged in.  we do this so that the UserPrincipal is available on unsecured, unconstrainted URLs
    super.invoke(request, response);
  } finally {
  }
}
origin: org.keycloak/keycloak-saml-tomcat-adapter-core

protected void logoutInternal(Request request) {
  CatalinaHttpFacade facade = new CatalinaHttpFacade(null, request);
  SamlDeployment deployment = deploymentContext.resolveDeployment(facade);
  SamlSessionStore tokenStore = getSessionStore(request, facade, deployment);
  tokenStore.logoutAccount();
  request.setUserPrincipal(null);
}
origin: org.keycloak/keycloak-saml-adapter-core

@Override
protected AuthOutcome logoutRequest(LogoutRequestType request, String relayState) {
  if (request.getSessionIndex() == null || request.getSessionIndex().isEmpty()) {
    sessionStore.logoutByPrincipal(request.getNameID().getValue());
  } else {
    sessionStore.logoutBySsoId(request.getSessionIndex());
origin: org.keycloak/keycloak-saml-adapter-core

final String sessionIndex = index;
SamlSession account = new SamlSession(principal, roles, sessionIndex);
sessionStore.saveAccount(account);
onCreateSession.onSessionCreated(account);
String redirectUri = sessionStore.getRedirectUri();
if (redirectUri != null) {
  facade.getResponse().setHeader("Location", redirectUri);
origin: org.keycloak/keycloak-saml-adapter-core

private AuthOutcome globalLogout() {
  SamlSession account = sessionStore.getAccount();
  if (account == null) {
    return AuthOutcome.NOT_ATTEMPTED;
    sessionStore.setCurrentAction(SamlSessionStore.CurrentAction.LOGGING_OUT);
  } catch (Exception e) {
    log.error("Could not send global logout SAML request", e);
origin: org.keycloak/keycloak-saml-adapter-core

public AuthOutcome doHandle(SamlInvocationContext context, OnSessionCreated onCreateSession) {
  String samlRequest = context.getSamlRequest();
  String samlResponse = context.getSamlResponse();
  String relayState = context.getRelayState();
  if (samlRequest != null) {
    return handleSamlRequest(samlRequest, relayState);
  } else if (samlResponse != null) {
    return handleSamlResponse(samlResponse, relayState, onCreateSession);
  } else if (sessionStore.isLoggedIn()) {
    if (verifySSL()) return AuthOutcome.FAILED;
    log.debug("AUTHENTICATED: was cached");
    return handleRequest();
  }
  return initiateLogin();
}
org.keycloak.adapters.samlSamlSessionStore

Most used methods

  • isLoggedIn
  • logoutAccount
  • getAccount
  • getRedirectUri
  • isLoggingIn
  • isLoggingOut
  • logoutByPrincipal
  • logoutBySsoId
  • saveAccount
  • saveRequest
  • setCurrentAction
  • setCurrentAction

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getExternalFilesDir (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • compareTo (BigDecimal)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Top plugins for Android Studio
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