Package com.sas.services.user

# Interface UserIdentityInterface

All Known Implementing Classes:
  `SimpleUserIdentity`

public interface UserIdentityInterface
A user identity is an authenticatable principal and credential within a given domain.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object object)`
  Compare against another object for equality.
  `Object`
  `getCredential()`
  Get the credential for this identity.
  `String`
  `getDomain()`
  Get the string identifying the domain this identity applies to.
  `String`
  `getMechanism()`
  Get the authentication mechanism for this identity.
  `Object`
  `getPrincipal()`
  Get the principal.
  `String`
  `getResolvedUserName()`
  Get the user name that was resolved by the authentication server.
  `Object`
  `getUserIdentity()`
  Deprecated.
  User getPrincipal instead.
  `boolean`
  `isAuthenticated()`
  Return a flag indicating whether this identity has been authenticated or not.
  `boolean`
  `isPrimary()`
  Return a flag indicating if this is the primary authentication credential set.
  `void`
  `setAuthenticated(boolean value)`
  Set the flag indicating this identity has been authenticated.
  `void`
  `setCredential(Object credential)`
  Set the credential for this identity.
  `void`
  `setDomain(String domain)`
  Set the domain string for this identity.
  `void`
  `setPrincipal(Object principal)`
  Set the principal to use for authentication.
  `void`
  `setUserIdentity(Object identity)`
  Deprecated.
  This adds no useful information above and beyond the principal.

- ## Method Details

  - ### isAuthenticated

    boolean isAuthenticated()
    Return a flag indicating whether this identity has been authenticated or not.

    Returns:
      true if it has been authenticated, false otherwise.

  - ### isPrimary

    boolean isPrimary()
    Return a flag indicating if this is the primary authentication credential set.
    Returns:
      true if this identity was used for the primary authentication. False otherwise.

  - ### setAuthenticated

    void setAuthenticated(boolean value)
    Set the flag indicating this identity has been authenticated.

    Parameters:
      `value` - A true/false indicator of authentication.

  - ### getDomain

    String getDomain()
    Get the string identifying the domain this identity applies to.

    Returns:
      The domain string.

  - ### setDomain

    void setDomain(String domain)
    Set the domain string for this identity.

    Parameters:
      `domain` - The String that denotes the domain for this identity.

  - ### getUserIdentity

    Object getUserIdentity()
    Deprecated.
    User getPrincipal instead.
    Get the authenticated identity for this user. The authenticated identity might be different from the principal.

    Returns:
      An object that represents the authenticated identity.

  - ### setUserIdentity

    void setUserIdentity(Object identity)
    Deprecated.
    This adds no useful information above and beyond the principal.
    Set the authenticated identity for the user. This should only be set by the authentication mechanism.

    Parameters:
      `identity` - The new authenticated identity for the user in this domain.

  - ### getResolvedUserName

    String getResolvedUserName()
    Get the user name that was resolved by the authentication server. This will only be set on a primary identity, and only if the user is defined in the metadata (i.e., not a "public" user). This string will be of the form user@domain for Windows domains, and just user for non-Windows platforms. This string should be consistent regardless of whether the user logged in with username, domain\\username or username@domain.
    Returns:
      The domain-qualified user name as resolved by the authenticating server, or null if the user could not be resolved.

  - ### setPrincipal

    void setPrincipal(Object principal)
    Set the principal to use for authentication.

    Parameters:
      `principal` - The principal to use to authenticate this user.

  - ### getPrincipal

    Object getPrincipal()
    Get the principal.

    Returns:
      The principal string for this user in this domain.

  - ### setCredential

    void setCredential(Object credential)
    Set the credential for this identity.

    Parameters:
      `credential` - A credential for this identity.

  - ### getCredential

    Object getCredential()
    Get the credential for this identity.

    Returns:
      The credential.

  - ### getMechanism

    String getMechanism()
    Get the authentication mechanism for this identity. The mechanism string will most likely be hard-coded into the implementation.
    Returns:
      Identity's authentication mechanism.

  - ### equals

    boolean equals(Object object)
    Compare against another object for equality.

    Overrides:
      `equals` in class `Object`
    Parameters:
      `object` - The object to compare against
    Returns:
      true if the objects are equal, false otherwise