Class OpenIdConnectRealm
java.lang.Object
org.elasticsearch.xpack.core.security.authc.Realm
org.elasticsearch.xpack.security.authc.oidc.OpenIdConnectRealm
- All Implemented Interfaces:
Closeable,AutoCloseable,Comparable<org.elasticsearch.xpack.core.security.authc.Realm>,org.elasticsearch.core.Releasable
public class OpenIdConnectRealm
extends org.elasticsearch.xpack.core.security.authc.Realm
implements org.elasticsearch.core.Releasable
-
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
FieldsFields inherited from class org.elasticsearch.xpack.core.security.authc.Realm
config, logger -
Constructor Summary
ConstructorsConstructorDescriptionOpenIdConnectRealm(org.elasticsearch.xpack.core.security.authc.RealmConfig config, org.elasticsearch.xpack.core.ssl.SSLService sslService, org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper roleMapper, org.elasticsearch.watcher.ResourceWatcherService watcherService) -
Method Summary
Modifier and TypeMethodDescriptionvoidauthenticate(org.elasticsearch.xpack.core.security.authc.AuthenticationToken token, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.authc.AuthenticationResult<org.elasticsearch.xpack.core.security.user.User>> listener) org.elasticsearch.xpack.core.security.action.oidc.OpenIdConnectPrepareAuthenticationResponsebuildAuthenticationRequestUri(String existingState, String existingNonce, String loginHint) Creates the URI for an OIDC Authentication Request from the realm configuration using URI Query String Serialization and possibly generates a state parameter and a nonce.org.elasticsearch.xpack.core.security.action.oidc.OpenIdConnectLogoutResponsebuildLogoutResponse(com.nimbusds.jwt.JWT idTokenHint) voidclose()voidinitialize(Iterable<org.elasticsearch.xpack.core.security.authc.Realm> realms, org.elasticsearch.license.XPackLicenseState licenseState) booleanisIssuerValid(String issuer) 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 context) Methods inherited from class org.elasticsearch.xpack.core.security.authc.Realm
compareTo, domain, getAuthenticationFailureHeaders, name, order, toString, type, usageStats
-
Field Details
-
CONTEXT_TOKEN_DATA
- See Also:
-
-
Constructor Details
-
OpenIdConnectRealm
public OpenIdConnectRealm(org.elasticsearch.xpack.core.security.authc.RealmConfig config, org.elasticsearch.xpack.core.ssl.SSLService sslService, org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper roleMapper, org.elasticsearch.watcher.ResourceWatcherService watcherService)
-
-
Method Details
-
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
-
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 context) - Specified by:
tokenin classorg.elasticsearch.xpack.core.security.authc.Realm
-
authenticate
public void authenticate(org.elasticsearch.xpack.core.security.authc.AuthenticationToken token, 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
-
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
-
buildAuthenticationRequestUri
public org.elasticsearch.xpack.core.security.action.oidc.OpenIdConnectPrepareAuthenticationResponse buildAuthenticationRequestUri(@Nullable String existingState, @Nullable String existingNonce, @Nullable String loginHint) Creates the URI for an OIDC Authentication Request from the realm configuration using URI Query String Serialization and possibly generates a state parameter and a nonce. It then returns the URI, state and nonce encapsulated in aOpenIdConnectPrepareAuthenticationResponse. A facilitator can provide a state and a nonce parameter in two cases:- In case of Kibana, it allows for a better UX by ensuring that all requests to an OpenID Connect Provider within the same browser context (even across tabs) will use the same state and nonce values.
- In case of custom facilitators, the implementer might require/support generating the state parameter in order to tie this to an anti-XSRF token.
- Parameters:
existingState- An existing state that can be reused or null if we need to generate oneexistingNonce- An existing nonce that can be reused or null if we need to generate oneloginHint- A String with a login hint to add to the authentication request in case of a 3rd party initiated login- Returns:
- an
OpenIdConnectPrepareAuthenticationResponse
-
isIssuerValid
-
buildLogoutResponse
public org.elasticsearch.xpack.core.security.action.oidc.OpenIdConnectLogoutResponse buildLogoutResponse(com.nimbusds.jwt.JWT idTokenHint) -
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.elasticsearch.core.Releasable
-