Enum Class AuthMode

java.lang.Object
java.lang.Enum<AuthMode>
com.cloudforge.core.enums.AuthMode
All Implemented Interfaces:
Serializable, Comparable<AuthMode>, Constable

public enum AuthMode extends Enum<AuthMode>
Authentication mode for application access control.

Configuration

Set via deployment context:

 cfc.put("authMode", "none");             // No authentication
 cfc.put("authMode", "alb-oidc");         // ALB handles OIDC (recommended)
 cfc.put("authMode", "application-oidc"); // Application handles OIDC
 

Modes

  • NONE - No authentication, application handles its own auth
  • ALB_OIDC - ALB enforces OIDC before traffic reaches application
  • APPLICATION_OIDC - Application handles OIDC internally

ALB-OIDC Benefits

  • Zero code changes - authentication at infrastructure level
  • Consistent auth across all applications
  • Automatic token validation and refresh
  • Works with Cognito, IAM Identity Center, Okta, Auth0, etc.

Requirements

  • ALB-OIDC requires ALB load balancer (lbType=alb)
  • Both OIDC modes require SSL enabled (enableSsl=true)
  • Enum Constant Details

    • NONE

      public static final AuthMode NONE
      No CloudForge-managed authentication. Application may handle its own authentication internally.
    • ALB_OIDC

      public static final AuthMode ALB_OIDC
      ALB handles OIDC authentication. Unauthenticated requests are redirected to IdP login. Authenticated requests include user claims in headers. Requires ALB (not NLB) and SSL enabled.
    • APPLICATION_OIDC

      public static final AuthMode APPLICATION_OIDC
      Application handles OIDC internally. ALB passes all traffic through, application validates tokens. Useful for applications with built-in OIDC support.
  • 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
    • getValue

      public String getValue()
      Returns the JSON/string value for this auth mode.
    • toString

      public String toString()
      Returns the string representation.
      Overrides:
      toString in class Enum<AuthMode>
    • fromString

      public static AuthMode fromString(String value)
      Parse auth mode from string (case-insensitive).
      Parameters:
      value - String value from deployment context
      Returns:
      AuthMode enum value
      Throws:
      IllegalArgumentException - if value is not recognized
    • usesOidc

      public boolean usesOidc()
      Check if this mode uses OIDC authentication.
    • requiresAlb

      public boolean requiresAlb()
      Check if this mode requires ALB (not NLB).
    • requiresSsl

      public boolean requiresSsl()
      Check if this mode requires SSL.
    • isAlbAuthenticated

      public boolean isAlbAuthenticated()
      Check if authentication is handled at ALB level.