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.TokenRequestBasedAuthenticatorImmutable<IamToken,IamToken>
-
- com.ibm.cloud.sdk.core.security.IamRequestBasedAuthenticatorImmutable
-
- com.ibm.cloud.sdk.core.security.IamRequestBasedAuthenticator
-
- All Implemented Interfaces:
Authenticator
- Direct Known Subclasses:
ContainerAuthenticator,IamAuthenticator
public abstract class IamRequestBasedAuthenticator extends IamRequestBasedAuthenticatorImmutable implements Authenticator
This class effectively adds some setter functions to the IamRequestBasedAuthenticatorImmutable class in order to allow subclasses (e.g. IamAuthenticator, ContainerAuthenticator) to be mutable after construction.
-
-
Field Summary
-
Fields inherited from class com.ibm.cloud.sdk.core.security.AuthenticatorBase
ERRORMSG_ACCOUNTID_PROP_ERROR, ERRORMSG_ATLEAST_ONE_PROP_ERROR, ERRORMSG_ATMOST_ONE_PROP_ERROR, ERRORMSG_EXCLUSIVE_PROP_ERROR, ERRORMSG_PROP_INVALID, ERRORMSG_PROP_INVALID_BOOL, 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_IAM_ASSUME, AUTHTYPE_MCSP, AUTHTYPE_MCSPV2, AUTHTYPE_NOAUTH, AUTHTYPE_VPC, PROPNAME_APIKEY, PROPNAME_AUTH_TYPE, PROPNAME_BEARER_TOKEN, PROPNAME_CALLER_EXT_CLAIM, PROPNAME_CLIENT_ID, PROPNAME_CLIENT_SECRET, PROPNAME_CR_TOKEN_FILENAME, PROPNAME_DISABLE_SSL, PROPNAME_DISPLAY_NAME, PROPNAME_EXPIRATION_TIME, PROPNAME_IAM_ACCOUNT_ID, PROPNAME_IAM_PROFILE_CRN, PROPNAME_IAM_PROFILE_ID, PROPNAME_IAM_PROFILE_NAME, PROPNAME_INCLUDE_BUILTIN_ACTIONS, PROPNAME_INCLUDE_CUSTOM_ACTIONS, PROPNAME_INCLUDE_ROLES, PROPNAME_PASSWORD, PROPNAME_PERMISSIONS, PROPNAME_PREFIX_ROLES, PROPNAME_SCOPE, PROPNAME_SCOPE_COLLECTION_TYPE, PROPNAME_SCOPE_ID, 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 voidsetClient(okhttp3.OkHttpClient client)Sets the OkHttpClient instance to be used when interacting with the token service.voidsetClientIdAndSecret(java.lang.String clientId, java.lang.String clientSecret)Sets the clientId and clientSecret on this Authenticator.voidsetDisableSSLVerification(boolean disableSSLVerification)Sets the disableSSLVerification flag.voidsetHeaders(java.util.Map<java.lang.String,java.lang.String> headers)Sets a Map of key/value pairs which will be sent as HTTP headers in any interactions with the token service.voidsetProxy(java.net.Proxy proxy)Sets a Proxy object on this Authenticator.voidsetProxyAuthenticator(okhttp3.Authenticator proxyAuthenticator)Sets a proxy authenticator on this Authenticator instance.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.-
Methods inherited from class com.ibm.cloud.sdk.core.security.IamRequestBasedAuthenticatorImmutable
getClientId, getClientSecret, getScope, getURL, validate
-
Methods inherited from class com.ibm.cloud.sdk.core.security.TokenRequestBasedAuthenticatorImmutable
authenticate, authenticationType, getClient, getDisableSSLVerification, getHeaders, getProxy, getProxyAuthenticator, getToken, requestToken
-
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, validate
-
-
-
-
Method Detail
-
setURL
public void setURL(java.lang.String url)
Sets the URL on this Authenticator.- Parameters:
url- the URL representing the IAM token server endpoint
-
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
-
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.
-
setDisableSSLVerification
public void setDisableSSLVerification(boolean disableSSLVerification)
Sets the disableSSLVerification flag.- Parameters:
disableSSLVerification- a flag indicating whether SSL host verification should be disabled
-
setHeaders
public void setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Sets a Map of key/value pairs which will be sent as HTTP headers in any interactions with the token service.- Parameters:
headers- the user-supplied headers to be included in token service interactions
-
setProxy
public void setProxy(java.net.Proxy proxy)
Sets a Proxy object on this Authenticator.- Parameters:
proxy- the proxy object to be associated with the Client used to interact with the token service.
-
setProxyAuthenticator
public void setProxyAuthenticator(okhttp3.Authenticator proxyAuthenticator)
Sets a proxy authenticator on this Authenticator instance.- Parameters:
proxyAuthenticator- the proxy authenticator
-
setClient
public void setClient(okhttp3.OkHttpClient client)
Sets the OkHttpClient instance to be used when interacting with the token service.- Parameters:
client- the OkHttpClient instance to use
-
-