Package com.ibm.cloud.sdk.core.security
Class IamRequestBasedAuthenticator
- java.lang.Object
-
- com.ibm.cloud.sdk.core.security.AuthenticatorBase
-
- com.ibm.cloud.sdk.core.security.TokenRequestBasedAuthenticator<IamToken,IamToken>
-
- com.ibm.cloud.sdk.core.security.IamRequestBasedAuthenticator
-
- All Implemented Interfaces:
Authenticator
- Direct Known Subclasses:
ContainerAuthenticator,IamAuthenticator
public abstract class IamRequestBasedAuthenticator extends TokenRequestBasedAuthenticator<IamToken,IamToken> implements Authenticator
This class contains code that is common to all authenticators that need to interact with the IAM tokens service to obtain an access token.
-
-
Field Summary
-
Fields inherited from class com.ibm.cloud.sdk.core.security.AuthenticatorBase
ERRORMSG_ATLEAST_ONE_PROP_ERROR, ERRORMSG_ATMOST_ONE_PROP_ERROR, ERRORMSG_EXCLUSIVE_PROP_ERROR, ERRORMSG_PROP_INVALID, ERRORMSG_PROP_INVALID_INTEGER_VALUE, ERRORMSG_PROP_MISSING, ERRORMSG_REQ_FAILED
-
Fields inherited from interface com.ibm.cloud.sdk.core.security.Authenticator
AUTHTYPE_BASIC, AUTHTYPE_BEARER_TOKEN, AUTHTYPE_CONTAINER, AUTHTYPE_CP4D, AUTHTYPE_CP4D_SERVICE, AUTHTYPE_CP4D_SERVICE_INSTANCE, AUTHTYPE_IAM, AUTHTYPE_NOAUTH, AUTHTYPE_VPC, PROPNAME_APIKEY, PROPNAME_AUTH_TYPE, PROPNAME_BEARER_TOKEN, PROPNAME_CLIENT_ID, PROPNAME_CLIENT_SECRET, PROPNAME_CR_TOKEN_FILENAME, PROPNAME_DISABLE_SSL, PROPNAME_DISPLAY_NAME, PROPNAME_EXPIRATION_TIME, PROPNAME_IAM_PROFILE_CRN, PROPNAME_IAM_PROFILE_ID, PROPNAME_IAM_PROFILE_NAME, PROPNAME_PASSWORD, PROPNAME_PERMISSIONS, PROPNAME_SCOPE, PROPNAME_SERVICE_BROKER_SECRET, PROPNAME_SERVICE_INSTANCE_ID, PROPNAME_UID, PROPNAME_URL, PROPNAME_USERNAME
-
-
Constructor Summary
Constructors Constructor Description IamRequestBasedAuthenticator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetClientId()java.lang.StringgetClientSecret()java.lang.StringgetScope()java.lang.StringgetURL()voidsetClientIdAndSecret(java.lang.String clientId, java.lang.String clientSecret)Sets the clientId and clientSecret on this Authenticator.voidsetScope(java.lang.String value)Sets the "scope" parameter to use when fetching the bearer token from the IAM token server.voidsetURL(java.lang.String url)Sets the URL on this Authenticator.voidvalidate()Validates the configuration properties associated with the Authenticator.-
Methods inherited from class com.ibm.cloud.sdk.core.security.TokenRequestBasedAuthenticator
authenticate, authenticationType, getClient, getDisableSSLVerification, getHeaders, getProxy, getProxyAuthenticator, getToken, requestToken, setClient, setDisableSSLVerification, setHeaders, setProxy, setProxyAuthenticator
-
Methods inherited from class com.ibm.cloud.sdk.core.security.AuthenticatorBase
constructBasicAuthHeader, constructBearerTokenAuthHeader
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.cloud.sdk.core.security.Authenticator
authenticate, authenticationType
-
-
-
-
Method Detail
-
validate
public void validate()
Description copied from class:TokenRequestBasedAuthenticatorValidates the configuration properties associated with the Authenticator. Each concrete subclass must implement this method.- Specified by:
validatein interfaceAuthenticator- Specified by:
validatein classTokenRequestBasedAuthenticator<IamToken,IamToken>
-
getURL
public java.lang.String getURL()
- Returns:
- the URL configured on this Authenticator.
-
setURL
public void setURL(java.lang.String url)
Sets the URL on this Authenticator.- Parameters:
url- the URL representing the IAM token server endpoint
-
getClientId
public java.lang.String getClientId()
- Returns:
- the clientId configured on this Authenticator.
-
getClientSecret
public java.lang.String getClientSecret()
- Returns:
- the clientSecret configured on this Authenticator.
-
setClientIdAndSecret
public void setClientIdAndSecret(java.lang.String clientId, java.lang.String clientSecret)Sets the clientId and clientSecret on this Authenticator.- Parameters:
clientId- the clientId to use in interactions with the token serverclientSecret- the clientSecret to use in interactions with the token server
-
getScope
public java.lang.String getScope()
- Returns:
- the scope parameter
-
setScope
public void setScope(java.lang.String value)
Sets the "scope" parameter to use when fetching the bearer token from the IAM token server.- Parameters:
value- a space seperated string that makes up the scope parameter.
-
-