Class MCSPV2Authenticator.Builder

  • Enclosing class:
    MCSPV2Authenticator

    public static class MCSPV2Authenticator.Builder
    extends java.lang.Object
    This Builder class is used to construct MCSPV2Authenticator instances.
    • Constructor Detail

      • Builder

        public Builder()
        Constructs an empty Builder.
    • 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