Class SamlRealm
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-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.xpack.core.security.authc.Realm
org.elasticsearch.xpack.core.security.authc.Realm.Factory -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.elasticsearch.xpack.core.security.authc.Realm
config -
Method Summary
Modifier and TypeMethodDescriptionvoidauthenticate(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) org.opensaml.saml.saml2.core.AuthnRequestorg.opensaml.saml.saml2.core.LogoutRequestbuildLogoutRequest(org.opensaml.saml.saml2.core.NameID nameId, String session) Creates a SAMLSingle LogOut requestfor the provided session, if the realm and IdP configuration support SLO.org.opensaml.saml.saml2.core.LogoutResponsebuildLogoutResponse(String inResponseTo) Creates a SAMLLogoutResponseto the provided requestIDvoidclose()static SamlRealmcreate(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) Factory for SAML realm.createTokenMetadata(SamlNameId nameId, String session) findSamlRealms(Realms realms, String realmName, String acsUrl) voidinitialize(Iterable<org.elasticsearch.xpack.core.security.authc.Realm> realms, org.elasticsearch.license.XPackLicenseState licenseState) voidlookupUser(String username, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.user.User> listener) booleansupports(org.elasticsearch.xpack.core.security.authc.AuthenticationToken token) org.elasticsearch.xpack.core.security.authc.AuthenticationTokentoken(org.elasticsearch.common.util.concurrent.ThreadContext threadContext) Always returnsnullas there is no support for reading a SAML token out of a requestMethods inherited from class org.elasticsearch.xpack.core.security.authc.Realm
compareTo, domain, getAuthenticationFailureHeaders, name, order, toString, type, usageStats
-
Field Details
-
USER_METADATA_NAMEID_VALUE
- See Also:
-
USER_METADATA_NAMEID_FORMAT
- See Also:
-
CONTEXT_TOKEN_DATA
- See Also:
-
TOKEN_METADATA_NAMEID_VALUE
- See Also:
-
TOKEN_METADATA_NAMEID_FORMAT
- See Also:
-
TOKEN_METADATA_NAMEID_QUALIFIER
- See Also:
-
TOKEN_METADATA_NAMEID_SP_QUALIFIER
- See Also:
-
TOKEN_METADATA_NAMEID_SP_PROVIDED_ID
- See Also:
-
TOKEN_METADATA_SESSION
- See Also:
-
TOKEN_METADATA_REALM
- See Also:
-
-
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 toSamlRealm(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
-
initialize
public void initialize(Iterable<org.elasticsearch.xpack.core.security.authc.Realm> realms, org.elasticsearch.license.XPackLicenseState licenseState) - Overrides:
initializein classorg.elasticsearch.xpack.core.security.authc.Realm
-
findSamlRealms
-
supports
public boolean supports(org.elasticsearch.xpack.core.security.authc.AuthenticationToken token) - Specified by:
supportsin classorg.elasticsearch.xpack.core.security.authc.Realm
-
token
public org.elasticsearch.xpack.core.security.authc.AuthenticationToken token(org.elasticsearch.common.util.concurrent.ThreadContext threadContext) Always returnsnullas there is no support for reading a SAML token out of a request- Specified by:
tokenin classorg.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:
authenticatein classorg.elasticsearch.xpack.core.security.authc.Realm
-
createTokenMetadata
-
lookupUser
public void lookupUser(String username, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.user.User> listener) - Specified by:
lookupUserin classorg.elasticsearch.xpack.core.security.authc.Realm
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-
serviceProviderEntityId
-
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 SAMLSingle LogOut requestfor the provided session, if the realm and IdP configuration support SLO. Otherwise returnsnull- See Also:
-
SamlRealmSettings.IDP_SINGLE_LOGOUT
-
buildLogoutResponse
Creates a SAMLLogoutResponseto the provided requestID -
getSigningConfiguration
-
getLogoutHandler
-
getLogoutResponseHandler
-