com.aspose.email

Interfaces

Classes

Enums

Exceptions

com.aspose.email

Class OAuthNetworkCredential

  • All Implemented Interfaces:
    ICredentials, ICredentialsByHost


    public class OAuthNetworkCredential
    extends NetworkCredential
    implements ICredentialsByHost

    Represents the NetworkCredential for OAuth authentication.

    • Constructor Detail

      • OAuthNetworkCredential

        public OAuthNetworkCredential(String accessToken)

        Initializes a new instance of the OAuthNetworkCredential class

        Parameters:
        accessToken - Access token
      • OAuthNetworkCredential

        public OAuthNetworkCredential(ITokenProvider tokenProvider)

        Initializes a new instance of the OAuthNetworkCredential class

        Parameters:
        tokenProvider - Token provider
      • OAuthNetworkCredential

        public OAuthNetworkCredential(String userName,
                              String accessToken)

        Initializes a new instance of the OAuthNetworkCredential class

        Parameters:
        userName - User name
        accessToken - Access token
      • OAuthNetworkCredential

        public OAuthNetworkCredential(String userName,
                              ITokenProvider tokenProvider)

        Initializes a new instance of the OAuthNetworkCredential class

        Parameters:
        userName - User name
        tokenProvider - Token provider
    • Method Detail

      • getAccessToken

        public final String getAccessToken()

        Gets OAuth 2.0 access token.

      • getTokenProvider

        public final ITokenProvider getTokenProvider()

        Gets the token provider.

      • getCredential

        public final NetworkCredential getCredential(String host,
                                      int port,
                                      String authenticationType)
        Specified by:
        getCredential in interface ICredentialsByHost
        Overrides:
        getCredential in class NetworkCredential