OAuthNetworkCredential

Inheritance: java.lang.Object, com.aspose.ms.System.Net.NetworkCredential

All Implemented Interfaces: com.aspose.ms.System.Net.ICredentialsByHost

public class OAuthNetworkCredential extends System.Net.NetworkCredential implements System.Net.ICredentialsByHost

Represents the NetworkCredential for OAuth authentication.

Constructors

Constructor Description
OAuthNetworkCredential(String accessToken) Initializes a new instance of the OAuthNetworkCredential class
OAuthNetworkCredential(ITokenProvider tokenProvider) Initializes a new instance of the OAuthNetworkCredential class
OAuthNetworkCredential(String userName, String accessToken) Initializes a new instance of the OAuthNetworkCredential class
OAuthNetworkCredential(String userName, ITokenProvider tokenProvider) Initializes a new instance of the OAuthNetworkCredential class

Methods

Method Description
getAccessToken() Gets OAuth 2.0 access token.
getTokenProvider() Gets the token provider.
getCredential(String host, int port, String authenticationType) {@inheritDoc}

OAuthNetworkCredential(String accessToken)

public OAuthNetworkCredential(String accessToken)

Initializes a new instance of the OAuthNetworkCredential class

Parameters:

Parameter Type Description
accessToken java.lang.String Access token

OAuthNetworkCredential(ITokenProvider tokenProvider)

public OAuthNetworkCredential(ITokenProvider tokenProvider)

Initializes a new instance of the OAuthNetworkCredential class

Parameters:

Parameter Type Description
tokenProvider ITokenProvider Token provider

OAuthNetworkCredential(String userName, String accessToken)

public OAuthNetworkCredential(String userName, String accessToken)

Initializes a new instance of the OAuthNetworkCredential class

Parameters:

Parameter Type Description
userName java.lang.String User name
accessToken java.lang.String Access token

OAuthNetworkCredential(String userName, ITokenProvider tokenProvider)

public OAuthNetworkCredential(String userName, ITokenProvider tokenProvider)

Initializes a new instance of the OAuthNetworkCredential class

Parameters:

Parameter Type Description
userName java.lang.String User name
tokenProvider ITokenProvider Token provider

getAccessToken()

public final String getAccessToken()

Gets OAuth 2.0 access token.

Returns: java.lang.String

getTokenProvider()

public final ITokenProvider getTokenProvider()

Gets the token provider.

Returns: ITokenProvider

getCredential(String host, int port, String authenticationType)

public final System.Net.NetworkCredential getCredential(String host, int port, String authenticationType)

Parameters:

Parameter Type Description
host java.lang.String
port int
authenticationType java.lang.String

Returns: com.aspose.ms.System.Net.NetworkCredential