Module org.elasticsearch.xcore
Class SecondaryAuthentication
java.lang.Object
org.elasticsearch.xpack.core.security.authc.support.SecondaryAuthentication
Some Elasticsearch APIs need to be provided with 2 sets of credentials.
Typically this happens when a system user needs to perform an action while accessing data on behalf of, or user information regarding
a logged in user.
This class is a representation of that secondary user that can be activated in the security context while processing specific blocks
of code or within a listener.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSecondaryAuthentication(SecurityContext securityContext, Authentication authentication) -
Method Summary
Modifier and TypeMethodDescriptionboolean<T> Texecute(Function<ThreadContext.StoredContext, T> body) getUser()inthashCode()static SecondaryAuthenticationreadFromContext(SecurityContext securityContext) toString()voidwriteToContext(ThreadContext threadContext)
-
Field Details
-
THREAD_CTX_KEY
- See Also:
-
-
Constructor Details
-
SecondaryAuthentication
-
-
Method Details
-
readFromContext
@Nullable public static SecondaryAuthentication readFromContext(SecurityContext securityContext) throws IOException - Throws:
IOException
-
writeToContext
- Throws:
IOException
-
getAuthentication
-
getUser
-
execute
-
wrap
-
toString
-
equals
-
hashCode
public int hashCode()
-