Record Class CamundaAuthentication

java.lang.Object
java.lang.Record
io.camunda.security.auth.CamundaAuthentication
All Implemented Interfaces:
Serializable

public record CamundaAuthentication(String authenticatedUsername, String authenticatedClientId, List<String> authenticatedGroupIds, List<String> authenticatedRoleIds, List<String> authenticatedTenantIds, List<String> authenticatedMappingRuleIds, Map<String,Object> claims) extends Record implements Serializable
Represents the authentication context for a user or client in Camunda, including (where appropriate) their username or client ID, group memberships, roles, tenants, mapping rules, and associated claims.

Either authenticatedUsername or authenticatedClientId must be set, but not both, unless the authentication represents an anonymous user in which case both can be null.

See Also:
  • Constructor Details

    • CamundaAuthentication

      public CamundaAuthentication(String authenticatedUsername, String authenticatedClientId, List<String> authenticatedGroupIds, List<String> authenticatedRoleIds, List<String> authenticatedTenantIds, List<String> authenticatedMappingRuleIds, Map<String,Object> claims)
      Creates an instance of a CamundaAuthentication record class.
      Parameters:
      authenticatedUsername - the value for the authenticatedUsername record component
      authenticatedClientId - the value for the authenticatedClientId record component
      authenticatedGroupIds - the value for the authenticatedGroupIds record component
      authenticatedRoleIds - the value for the authenticatedRoleIds record component
      authenticatedTenantIds - the value for the authenticatedTenantIds record component
      authenticatedMappingRuleIds - the value for the authenticatedMappingRuleIds record component
      claims - the value for the claims record component
  • Method Details

    • isAnonymous

      public boolean isAnonymous()
    • none

      public static CamundaAuthentication none()
    • anonymous

      public static CamundaAuthentication anonymous()
    • of

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • authenticatedUsername

      public String authenticatedUsername()
      Returns the value of the authenticatedUsername record component.
      Returns:
      the value of the authenticatedUsername record component
    • authenticatedClientId

      public String authenticatedClientId()
      Returns the value of the authenticatedClientId record component.
      Returns:
      the value of the authenticatedClientId record component
    • authenticatedGroupIds

      public List<String> authenticatedGroupIds()
      Returns the value of the authenticatedGroupIds record component.
      Returns:
      the value of the authenticatedGroupIds record component
    • authenticatedRoleIds

      public List<String> authenticatedRoleIds()
      Returns the value of the authenticatedRoleIds record component.
      Returns:
      the value of the authenticatedRoleIds record component
    • authenticatedTenantIds

      public List<String> authenticatedTenantIds()
      Returns the value of the authenticatedTenantIds record component.
      Returns:
      the value of the authenticatedTenantIds record component
    • authenticatedMappingRuleIds

      public List<String> authenticatedMappingRuleIds()
      Returns the value of the authenticatedMappingRuleIds record component.
      Returns:
      the value of the authenticatedMappingRuleIds record component
    • claims

      public Map<String,Object> claims()
      Returns the value of the claims record component.
      Returns:
      the value of the claims record component