java.lang.Object
org.elasticsearch.xpack.core.security.authc.Realm
org.elasticsearch.xpack.security.authc.saml.SamlRealm
All Implemented Interfaces:
Closeable, AutoCloseable, Comparable<org.elasticsearch.xpack.core.security.authc.Realm>, org.elasticsearch.core.Releasable

public final class SamlRealm extends org.elasticsearch.xpack.core.security.authc.Realm implements org.elasticsearch.core.Releasable
This class is Releasable because it uses a library that thinks timers and timer tasks are still cool and no chance to opt out
  • Field Details

  • Method Details

    • create

      public static SamlRealm create(org.elasticsearch.xpack.core.security.authc.RealmConfig config, org.elasticsearch.xpack.core.ssl.SSLService sslService, org.elasticsearch.watcher.ResourceWatcherService watcherService, org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper roleMapper) throws Exception
      Factory for SAML realm. This is not a constructor as it needs to initialise a number of components before delegating to SamlRealm(org.elasticsearch.xpack.core.security.authc.RealmConfig, org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper, org.elasticsearch.xpack.security.authc.saml.SamlAuthenticator, org.elasticsearch.xpack.security.authc.saml.SamlLogoutRequestHandler, org.elasticsearch.xpack.security.authc.saml.SamlLogoutResponseHandler, java.util.function.Supplier<org.opensaml.saml.saml2.metadata.EntityDescriptor>, org.elasticsearch.xpack.security.authc.saml.SpConfiguration)
      Throws:
      Exception
    • getServiceProvider

      public SpConfiguration getServiceProvider()
    • initialize

      public void initialize(Iterable<org.elasticsearch.xpack.core.security.authc.Realm> realms, org.elasticsearch.license.XPackLicenseState licenseState)
      Overrides:
      initialize in class org.elasticsearch.xpack.core.security.authc.Realm
    • findSamlRealms

      public static List<SamlRealm> findSamlRealms(Realms realms, String realmName, String acsUrl)
    • supports

      public boolean supports(org.elasticsearch.xpack.core.security.authc.AuthenticationToken token)
      Specified by:
      supports in class org.elasticsearch.xpack.core.security.authc.Realm
    • token

      public org.elasticsearch.xpack.core.security.authc.AuthenticationToken token(org.elasticsearch.common.util.concurrent.ThreadContext threadContext)
      Always returns null as there is no support for reading a SAML token out of a request
      Specified by:
      token in class org.elasticsearch.xpack.core.security.authc.Realm
      See Also:
    • authenticate

      public void authenticate(org.elasticsearch.xpack.core.security.authc.AuthenticationToken authenticationToken, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.authc.AuthenticationResult<org.elasticsearch.xpack.core.security.user.User>> listener)
      Specified by:
      authenticate in class org.elasticsearch.xpack.core.security.authc.Realm
    • createTokenMetadata

      public Map<String,Object> createTokenMetadata(SamlNameId nameId, String session)
    • lookupUser

      public void lookupUser(String username, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.user.User> listener)
      Specified by:
      lookupUser in class org.elasticsearch.xpack.core.security.authc.Realm
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.elasticsearch.core.Releasable
    • serviceProviderEntityId

      public String serviceProviderEntityId()
    • assertionConsumerServiceURL

      public String assertionConsumerServiceURL()
    • buildAuthenticationRequest

      public org.opensaml.saml.saml2.core.AuthnRequest buildAuthenticationRequest()
    • buildLogoutRequest

      public org.opensaml.saml.saml2.core.LogoutRequest buildLogoutRequest(org.opensaml.saml.saml2.core.NameID nameId, String session)
      Creates a SAML Single LogOut request for the provided session, if the realm and IdP configuration support SLO. Otherwise returns null
      See Also:
      • SamlRealmSettings.IDP_SINGLE_LOGOUT
    • buildLogoutResponse

      public org.opensaml.saml.saml2.core.LogoutResponse buildLogoutResponse(String inResponseTo)
      Creates a SAML LogoutResponse to the provided requestID
    • getSigningConfiguration

      public SigningConfiguration getSigningConfiguration()
    • getLogoutHandler

      public SamlLogoutRequestHandler getLogoutHandler()
    • getLogoutResponseHandler

      public SamlLogoutResponseHandler getLogoutResponseHandler()