Class TokenCredentials

    • Constructor Detail

      • TokenCredentials

        public TokenCredentials​(String scheme,
                                String token)
        Initializes a new instance of the TokenCredentials.
        Parameters:
        scheme - scheme to use. If null, defaults to Bearer
        token - valid token
    • Method Detail

      • getToken

        protected String getToken​(okhttp3.Request request)
                           throws IOException
        Get the secure token. Override this method to provide a mechanism for acquiring tokens.
        Parameters:
        request - the context of the HTTP request
        Returns:
        the secure token.
        Throws:
        IOException - exception thrown from token acquisition operations.
      • getScheme

        protected String getScheme()
        Get the authentication scheme.
        Returns:
        the authentication scheme
      • applyCredentialsFilter

        public void applyCredentialsFilter​(okhttp3.OkHttpClient.Builder clientBuilder)
        Description copied from interface: ServiceClientCredentials
        Apply the credentials to the HTTP client builder.
        Specified by:
        applyCredentialsFilter in interface ServiceClientCredentials
        Parameters:
        clientBuilder - the builder for building up an OkHttpClient