Enum Class AuthMode

java.lang.Object
java.lang.Enum<AuthMode>
io.leandev.appfuse.security.resourceserver.AuthMode
All Implemented Interfaces:
Serializable, Comparable<AuthMode>, Constable

public enum AuthMode extends Enum<AuthMode>

資源伺服器的認證模式(雙模式,二擇一)

見 ADR-009「認證授權架構——雙模式資源伺服器」。兩模式共用同一套 oauth2ResourceServer().jwt() 驗證核心與 @PreAuthorize 授權,差異只在 token 來源,由設定 app.security.auth.mode 切換,啟動時驗證互斥。

  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    聯邦模式:app-server 當純資源伺服器,驗證外部企業 IdP(Keycloak/Okta,OIDC) 簽發的 token(透過 issuer-uri 的 JWKS)。人類與 M2M 皆在 IdP 認證。
    自簽模式:app-server 以本地 RSA 金鑰對自行簽發並驗證 JWT (login + client_credentials),保留黑名單與登入鎖定。適用於無企業 IdP 的部署。
  • Method Summary

    Modifier and Type
    Method
    Description
    static AuthMode
    Returns the enum constant of this class with the specified name.
    static AuthMode[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • STANDALONE

      public static final AuthMode STANDALONE
      自簽模式:app-server 以本地 RSA 金鑰對自行簽發並驗證 JWT (login + client_credentials),保留黑名單與登入鎖定。適用於無企業 IdP 的部署。
    • FEDERATED

      public static final AuthMode FEDERATED
      聯邦模式:app-server 當純資源伺服器,驗證外部企業 IdP(Keycloak/Okta,OIDC) 簽發的 token(透過 issuer-uri 的 JWKS)。人類與 M2M 皆在 IdP 認證。
  • Method Details

    • values

      public static AuthMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AuthMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null