Package uk.ac.starlink.auth
Class AuthStatus
java.lang.Object
uk.ac.starlink.auth.AuthStatus
Characterises the authentication associated with a connection.
- Since:
- 7 Feb 2022
- Author:
- Mark Taylor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AuthStatus
Connection with no possible or actual authentication. -
Constructor Summary
ConstructorsConstructorDescriptionAuthStatus
(AuthType authType) Constructs an AuthStatus with a given type but no actual authentication.AuthStatus
(AuthType authType, boolean isAuthenticated, String authId) Constructs an AuthStatus with given characteristics. -
Method Summary
Modifier and TypeMethodDescriptionReturns the authenticated user ID for this connection.Returns the authentication type for this connection.Returns a non-null string that can be used to characterise the user identity.boolean
Indicates whether authentication has been established.toString()
-
Field Details
-
NO_AUTH
Connection with no possible or actual authentication.
-
-
Constructor Details
-
AuthStatus
Constructs an AuthStatus with a given type but no actual authentication.- Parameters:
authType
- authentication type
-
AuthStatus
Constructs an AuthStatus with given characteristics.- Parameters:
authType
- authentication typeisAuthenticated
- true if authentication has been establishedauthId
- user identifier for authenticated identity; should normally be non-null if isAuthenticated is true, but not guaranteed to be
-
-
Method Details
-
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
Returns the authenticated user ID for this connection. Usually this will be non-null iffisAuthenticated()
is true, but that's not guaranteed.- Returns:
- user ID
-
getIdentityString
Returns a non-null string that can be used to characterise the user identity.- Returns:
- non-null identity description
-
toString
-