java.lang.Object
org.elasticsearch.xpack.core.security.authc.Realm
org.elasticsearch.xpack.security.authc.jwt.JwtRealm
All Implemented Interfaces:
Closeable, AutoCloseable, Comparable<org.elasticsearch.xpack.core.security.authc.Realm>, org.elasticsearch.core.Releasable, org.elasticsearch.xpack.core.security.authc.support.CachingRealm

public class JwtRealm extends org.elasticsearch.xpack.core.security.authc.Realm implements org.elasticsearch.xpack.core.security.authc.support.CachingRealm, 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

    Fields inherited from class org.elasticsearch.xpack.core.security.authc.Realm

    config, logger
  • Constructor Summary

    Constructors
    Constructor
    Description
    JwtRealm(org.elasticsearch.xpack.core.security.authc.RealmConfig realmConfig, org.elasticsearch.threadpool.ThreadPool threadPool, org.elasticsearch.xpack.core.ssl.SSLService sslService, org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper userRoleMapper, org.elasticsearch.watcher.ResourceWatcherService resourceWatcherService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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)
     
    void
     
    void
    expire(String username)
     
    void
     
    static org.elasticsearch.common.settings.SecureString
    getHeaderSchemeParameters(org.elasticsearch.common.util.concurrent.ThreadContext threadContext, String headerName, String schemeValue, boolean ignoreCase)
     
    void
    initialize(Iterable<org.elasticsearch.xpack.core.security.authc.Realm> allRealms, org.elasticsearch.license.XPackLicenseState xpackLicenseState)
     
    void
    lookupUser(String username, org.elasticsearch.action.ActionListener<org.elasticsearch.xpack.core.security.user.User> listener)
     
    boolean
    supports(org.elasticsearch.xpack.core.security.authc.AuthenticationToken jwtAuthenticationToken)
     
    org.elasticsearch.xpack.core.security.authc.AuthenticationToken
    token(org.elasticsearch.common.util.concurrent.ThreadContext threadContext)
     
    void
    usageStats(org.elasticsearch.action.ActionListener<Map<String,Object>> listener)
     
    static void
    validateClientAuthorizationSettings(String clientAuthorizationType, org.elasticsearch.common.settings.SecureString clientAuthorizationSharedSecret, org.elasticsearch.xpack.core.security.authc.RealmConfig realmConfig)
     
    static void
    validateIssuerCredentialSettings(org.elasticsearch.xpack.core.security.authc.RealmConfig realmConfig, org.elasticsearch.common.settings.SecureString hmacSecretKey, String jwkSetPath, List<String> allowedSignatureAlgorithms)
     
    static org.elasticsearch.core.Tuple<URL,Path>
    validateJwkSetPathSetting(org.elasticsearch.xpack.core.security.authc.RealmConfig realmConfig, String jwkSetPath)
     

    Methods inherited from class org.elasticsearch.xpack.core.security.authc.Realm

    compareTo, domain, getAuthenticationFailureHeaders, name, order, toString, type

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.elasticsearch.xpack.core.security.authc.support.CachingRealm

    name
  • Constructor Details

    • JwtRealm

      public JwtRealm(org.elasticsearch.xpack.core.security.authc.RealmConfig realmConfig, org.elasticsearch.threadpool.ThreadPool threadPool, org.elasticsearch.xpack.core.ssl.SSLService sslService, org.elasticsearch.xpack.core.security.authc.support.UserRoleMapper userRoleMapper, org.elasticsearch.watcher.ResourceWatcherService resourceWatcherService)
  • Method Details

    • validateClientAuthorizationSettings

      public static void validateClientAuthorizationSettings(String clientAuthorizationType, org.elasticsearch.common.settings.SecureString clientAuthorizationSharedSecret, org.elasticsearch.xpack.core.security.authc.RealmConfig realmConfig) throws org.elasticsearch.common.settings.SettingsException
      Throws:
      org.elasticsearch.common.settings.SettingsException
    • validateIssuerCredentialSettings

      public static void validateIssuerCredentialSettings(org.elasticsearch.xpack.core.security.authc.RealmConfig realmConfig, org.elasticsearch.common.settings.SecureString hmacSecretKey, String jwkSetPath, List<String> allowedSignatureAlgorithms) throws org.elasticsearch.common.settings.SettingsException
      Throws:
      org.elasticsearch.common.settings.SettingsException
    • validateJwkSetPathSetting

      public static org.elasticsearch.core.Tuple<URL,Path> validateJwkSetPathSetting(org.elasticsearch.xpack.core.security.authc.RealmConfig realmConfig, String jwkSetPath)
    • initialize

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

      public boolean supports(org.elasticsearch.xpack.core.security.authc.AuthenticationToken jwtAuthenticationToken)
      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)
      Specified by:
      token in class org.elasticsearch.xpack.core.security.authc.Realm
    • 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
    • expire

      public void expire(String username)
      Specified by:
      expire in interface org.elasticsearch.xpack.core.security.authc.support.CachingRealm
    • expireAll

      public void expireAll()
      Specified by:
      expireAll in interface org.elasticsearch.xpack.core.security.authc.support.CachingRealm
    • 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
    • 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
    • usageStats

      public void usageStats(org.elasticsearch.action.ActionListener<Map<String,Object>> listener)
      Overrides:
      usageStats in class org.elasticsearch.xpack.core.security.authc.Realm
    • getHeaderSchemeParameters

      public static org.elasticsearch.common.settings.SecureString getHeaderSchemeParameters(org.elasticsearch.common.util.concurrent.ThreadContext threadContext, String headerName, String schemeValue, boolean ignoreCase)