Package com.ibm.cloud.sdk.core.security
Class AuthenticatorBase
- java.lang.Object
-
- com.ibm.cloud.sdk.core.security.AuthenticatorBase
-
- Direct Known Subclasses:
BasicAuthenticator
,BearerTokenAuthenticator
,TokenRequestBasedAuthenticatorImmutable
public class AuthenticatorBase extends java.lang.Object
This is a common base class used with the various Authenticator implementations.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ERRORMSG_ACCOUNTID_PROP_ERROR
static java.lang.String
ERRORMSG_ATLEAST_ONE_PROP_ERROR
static java.lang.String
ERRORMSG_ATMOST_ONE_PROP_ERROR
static java.lang.String
ERRORMSG_EXCLUSIVE_PROP_ERROR
static java.lang.String
ERRORMSG_PROP_INVALID
static java.lang.String
ERRORMSG_PROP_INVALID_BOOL
static java.lang.String
ERRORMSG_PROP_INVALID_INTEGER_VALUE
static java.lang.String
ERRORMSG_PROP_MISSING
Common error messages.static java.lang.String
ERRORMSG_REQ_FAILED
-
Constructor Summary
Constructors Constructor Description AuthenticatorBase()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
constructBasicAuthHeader(java.lang.String username, java.lang.String password)
Returns a "Basic" Authorization header value for the specified username and password.static java.lang.String
constructBearerTokenAuthHeader(java.lang.String bearerToken)
Returns a "Bearer" Authorization header value for the specified bearer token.
-
-
-
Field Detail
-
ERRORMSG_PROP_MISSING
public static final java.lang.String ERRORMSG_PROP_MISSING
Common error messages.- See Also:
- Constant Field Values
-
ERRORMSG_PROP_INVALID
public static final java.lang.String ERRORMSG_PROP_INVALID
- See Also:
- Constant Field Values
-
ERRORMSG_REQ_FAILED
public static final java.lang.String ERRORMSG_REQ_FAILED
- See Also:
- Constant Field Values
-
ERRORMSG_EXCLUSIVE_PROP_ERROR
public static final java.lang.String ERRORMSG_EXCLUSIVE_PROP_ERROR
- See Also:
- Constant Field Values
-
ERRORMSG_ATLEAST_ONE_PROP_ERROR
public static final java.lang.String ERRORMSG_ATLEAST_ONE_PROP_ERROR
- See Also:
- Constant Field Values
-
ERRORMSG_ATMOST_ONE_PROP_ERROR
public static final java.lang.String ERRORMSG_ATMOST_ONE_PROP_ERROR
- See Also:
- Constant Field Values
-
ERRORMSG_PROP_INVALID_INTEGER_VALUE
public static final java.lang.String ERRORMSG_PROP_INVALID_INTEGER_VALUE
- See Also:
- Constant Field Values
-
ERRORMSG_ACCOUNTID_PROP_ERROR
public static final java.lang.String ERRORMSG_ACCOUNTID_PROP_ERROR
- See Also:
- Constant Field Values
-
ERRORMSG_PROP_INVALID_BOOL
public static final java.lang.String ERRORMSG_PROP_INVALID_BOOL
- See Also:
- Constant Field Values
-
-
Method Detail
-
constructBasicAuthHeader
public static java.lang.String constructBasicAuthHeader(java.lang.String username, java.lang.String password)
Returns a "Basic" Authorization header value for the specified username and password.- Parameters:
username
- the usernamepassword
- the password- Returns:
- the Authorization header value in the form "Basic <encoded username and password>"
-
constructBearerTokenAuthHeader
public static java.lang.String constructBearerTokenAuthHeader(java.lang.String bearerToken)
Returns a "Bearer" Authorization header value for the specified bearer token.- Parameters:
bearerToken
- the token value to be included in the header- Returns:
- the Authorization header value in the form "Bearer <bearerToken>"
-
-