uk.ac.starlink.auth

## Class AuthStatus

- java.lang.Object
- - uk.ac.starlink.auth.AuthStatus

-     public class AuthStatus
      extends java.lang.Object

  Characterises the authentication associated with a connection.
  Since:
    7 Feb 2022

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static AuthStatus` | `NO_AUTH` Connection with no possible or actual authentication.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AuthStatus(AuthType authType)` Constructs an AuthStatus with a given type but no actual authentication.
    `AuthStatus(AuthType authType, boolean isAuthenticated, java.lang.String authId)` Constructs an AuthStatus with given characteristics.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getAuthenticatedId()` Returns the authenticated user ID for this connection.
    `AuthType` | `getAuthType()` Returns the authentication type for this connection.
    `java.lang.String` | `getIdentityString()` Returns a non-null string that can be used to characterise the user identity.
    `boolean` | `isAuthenticated()` Indicates whether authentication has been established.
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

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

- - ### Field Detail

    - #### NO_AUTH

          public static final AuthStatus NO_AUTH

      Connection with no possible or actual authentication.

  - ### Constructor Detail

    - #### AuthStatus

          public AuthStatus(AuthType authType)

      Constructs an AuthStatus with a given type but no actual authentication.
      Parameters:
        `authType` - authentication type

    - #### AuthStatus

          public AuthStatus(AuthType authType,
                            boolean isAuthenticated,
                            java.lang.String authId)

      Constructs an AuthStatus with given characteristics.
      Parameters:
        `authType` - authentication type
        `isAuthenticated` - true if authentication has been established
        `authId` - user identifier for authenticated identity; should normally be non-null if isAuthenticated is true, but not guaranteed to be

  - ### Method Detail

    - #### getAuthType

          public AuthType getAuthType()

      Returns the authentication type for this connection.
      Returns:
        authentication type

    - #### isAuthenticated

          public boolean isAuthenticated()

      Indicates whether authentication has been established.
      Returns:
        true for authenticated

    - #### getAuthenticatedId

          public java.lang.String getAuthenticatedId()

      Returns the authenticated user ID for this connection. Usually this will be non-null iff `isAuthenticated()` is true, but that's not guaranteed.
      Returns:
        user ID

    - #### getIdentityString

          public java.lang.String getIdentityString()

      Returns a non-null string that can be used to characterise the user identity.
      Returns:
        non-null identity description

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`