Package com.ibm.cloud.sdk.core.security
Class MCSPV2Authenticator.Builder
- java.lang.Object
-
- com.ibm.cloud.sdk.core.security.MCSPV2Authenticator.Builder
-
- Enclosing class:
- MCSPV2Authenticator
public static class MCSPV2Authenticator.Builder extends java.lang.ObjectThis Builder class is used to construct MCSPV2Authenticator instances.
-
-
Constructor Summary
Constructors Constructor Description Builder()Constructs an empty Builder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MCSPV2Authenticator.Builderapikey(java.lang.String apikey)Sets the apikey property.MCSPV2Authenticatorbuild()Constructs a new instance of MCSPAuthenticator from the builder's configuration.MCSPV2Authenticator.BuildercallerExtClaim(java.util.Map<java.lang.String,java.lang.String> callerExtClaim)Sets the callerExtClaim property.MCSPV2Authenticator.Builderclient(okhttp3.OkHttpClient client)Sets the client property.MCSPV2Authenticator.BuilderdisableSSLVerification(boolean disableSSLVerification)Sets the disableSSLVerification property.MCSPV2Authenticator.Builderheaders(java.util.Map<java.lang.String,java.lang.String> headers)Sets the headers property.MCSPV2Authenticator.BuilderincludeBuiltinActions(boolean includeBuiltinActions)Sets the includeBuiltinActions property.MCSPV2Authenticator.BuilderincludeCustomActions(boolean includeCustomActions)Sets the includeCustomActions property.MCSPV2Authenticator.BuilderincludeRoles(boolean includeRoles)Sets the includeRoles property.MCSPV2Authenticator.BuilderprefixRoles(boolean prefixRoles)Sets the prefixRoles property.MCSPV2Authenticator.Builderproxy(java.net.Proxy proxy)Sets the proxy property.MCSPV2Authenticator.BuilderproxyAuthenticator(okhttp3.Authenticator proxyAuthenticator)Sets the proxyAuthenticator property.MCSPV2Authenticator.BuilderscopeCollectionType(java.lang.String scopeCollectionType)Sets the scopeCollectionType property.MCSPV2Authenticator.BuilderscopeId(java.lang.String scopeId)Sets the scopeId property.MCSPV2Authenticator.Builderurl(java.lang.String url)Sets the url property.
-
-
-
Method Detail
-
build
public MCSPV2Authenticator build()
Constructs a new instance of MCSPAuthenticator from the builder's configuration.- Returns:
- the MCSPAuthenticator instance
-
apikey
public MCSPV2Authenticator.Builder apikey(java.lang.String apikey)
Sets the apikey property.- Parameters:
apikey- the apikey to use when retrieving an access token- Returns:
- the Builder
-
url
public MCSPV2Authenticator.Builder url(java.lang.String url)
Sets the url property.- Parameters:
url- the base url to use with the MCSP token service- Returns:
- the Builder
-
scopeCollectionType
public MCSPV2Authenticator.Builder scopeCollectionType(java.lang.String scopeCollectionType)
Sets the scopeCollectionType property.- Parameters:
scopeCollectionType- the scope collection type of item(s). Valid values are:- accounts
- subscriptions
- services
- Returns:
- the Builder
-
scopeId
public MCSPV2Authenticator.Builder scopeId(java.lang.String scopeId)
Sets the scopeId property.- Parameters:
scopeId- the scope identifier of item(s)- Returns:
- the Builder
-
includeBuiltinActions
public MCSPV2Authenticator.Builder includeBuiltinActions(boolean includeBuiltinActions)
Sets the includeBuiltinActions property.- Parameters:
includeBuiltinActions- a flag to include builtin actions in the "actions" claim in the MCSP access token (default: false).- Returns:
- the Builder
-
includeCustomActions
public MCSPV2Authenticator.Builder includeCustomActions(boolean includeCustomActions)
Sets the includeCustomActions property.- Parameters:
includeCustomActions- a flag to include custom actions in the "actions" claim in the MCSP access token (default: false).- Returns:
- the Builder
-
includeRoles
public MCSPV2Authenticator.Builder includeRoles(boolean includeRoles)
Sets the includeRoles property.- Parameters:
includeRoles- a flag to include the "roles" claim in the MCSP access token (default: true).- Returns:
- the Builder
-
prefixRoles
public MCSPV2Authenticator.Builder prefixRoles(boolean prefixRoles)
Sets the prefixRoles property.- Parameters:
prefixRoles- a flag to add a prefix with the scope level where the role is defined in the "roles" claim (default: false).- Returns:
- the Builder
-
callerExtClaim
public MCSPV2Authenticator.Builder callerExtClaim(java.util.Map<java.lang.String,java.lang.String> callerExtClaim)
Sets the callerExtClaim property.- Parameters:
callerExtClaim- a A map containing keys and values to be injected into the access token as the "callerExt" claim. The keys used in this map must be enabled in the apikey by setting the "callerExtClaimNames" property when the apikey is created. This property is typically only used in scenarios involving an apikey with identityType `SERVICEID`.- Returns:
- the Builder
-
disableSSLVerification
public MCSPV2Authenticator.Builder disableSSLVerification(boolean disableSSLVerification)
Sets the disableSSLVerification property.- Parameters:
disableSSLVerification- a boolean flag indicating whether or not SSL verification should be disabled when interacting with the MCSP token service- Returns:
- the Builder
-
headers
public MCSPV2Authenticator.Builder headers(java.util.Map<java.lang.String,java.lang.String> headers)
Sets the headers property.- Parameters:
headers- the set of custom headers to include in requests sent to the MCSP token service- Returns:
- the Builder
-
proxy
public MCSPV2Authenticator.Builder proxy(java.net.Proxy proxy)
Sets the proxy property.- Parameters:
proxy- the java.net.Proxy instance to be used when interacting with the MCSP token server- Returns:
- the Builder
-
proxyAuthenticator
public MCSPV2Authenticator.Builder proxyAuthenticator(okhttp3.Authenticator proxyAuthenticator)
Sets the proxyAuthenticator property.- Parameters:
proxyAuthenticator- the okhttp3.Authenticator instance to be used with the proxy when interacting with the MCSP token service- Returns:
- the Builder
-
client
public MCSPV2Authenticator.Builder client(okhttp3.OkHttpClient client)
Sets the client property.- Parameters:
client- the OkHttpClient instance that should be used by the authenticator when interacting with the MCSP token service- Returns:
- the Builder
-
-