TokenProvider

Inheritance: java.lang.Object

All Implemented Interfaces: com.aspose.email.ITokenProvider

public class TokenProvider implements ITokenProvider

Class TokenProvider allows to retrieve access token for mail services.

Methods

MethodDescription
dispose()Performs releasing resources.
equals(Object arg0)
getAccessToken()Gets oAuth access token.
getAccessToken(boolean ignoreExistingToken)Gets oAuth access token.
getClass()
getClientId()The client ID obtained during application registration.
getClientSecret()The client secret obtained during application registration.
getExtraParameters()Gets extra parameters for request
getInstance(String requestUrl, String clientId, String clientSecret, String refreshToken)Gets an instance of the OutlookTokenProvider for defined parameters.
getLogin()Gets or sets login for basic authorization
getPassword()Gets or sets password for basic authorization
getRefreshToken()OAuth 2.0 refresh token
getRequestUrl()The url to obtain access token.
getUseBasicAuthorization()Gets or sets value which indicates whether basic authorization is used
hashCode()
notify()
notifyAll()
setLogin(String value)Gets or sets login for basic authorization
setPassword(String value)Gets or sets password for basic authorization
setUseBasicAuthorization(boolean value)Gets or sets value which indicates whether basic authorization is used
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

dispose()

public void dispose()

Performs releasing resources.

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getAccessToken()

public OAuthToken getAccessToken()

Gets oAuth access token. If token exists and its expiration date is not expired returns current token, otherwise requests new token from a server.

Returns: OAuthToken - Returns oAuth access token

getAccessToken(boolean ignoreExistingToken)

public OAuthToken getAccessToken(boolean ignoreExistingToken)

Gets oAuth access token.

Parameters:

ParameterTypeDescription
ignoreExistingTokenbooleanIf ignoreExistingToken is true, requests new token from a server. Otherwise behaviour is depended on whether token exists or not. If token exists and its expiration date is not expired returns current token, otherwise requests new token from a server.

Returns: OAuthToken - Returns oAuth access token

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getClientId()

public String getClientId()

The client ID obtained during application registration.

Returns: java.lang.String

getClientSecret()

public String getClientSecret()

The client secret obtained during application registration.

Returns: java.lang.String

getExtraParameters()

public System.Collections.Generic.KeyValuePair<String,String>[] getExtraParameters()

Gets extra parameters for request

Returns: com.aspose.ms.System.Collections.Generic.KeyValuePair<java.lang.String,java.lang.String>[]

getInstance(String requestUrl, String clientId, String clientSecret, String refreshToken)

public static TokenProvider getInstance(String requestUrl, String clientId, String clientSecret, String refreshToken)

Gets an instance of the OutlookTokenProvider for defined parameters.

Parameters:

ParameterTypeDescription
requestUrljava.lang.StringThe url to obtain access token.
clientIdjava.lang.StringThe client ID obtained from the Microsoft account Developer Center during application registration.
clientSecretjava.lang.StringThe client secret obtained during application registration.
refreshTokenjava.lang.StringOAuth 2.0 refresh token

Returns: TokenProvider - Returns an instance of the OutlookTokenProvider for defined parameters.

getLogin()

public String getLogin()

Gets or sets login for basic authorization

Returns: java.lang.String

getPassword()

public String getPassword()

Gets or sets password for basic authorization

Returns: java.lang.String

getRefreshToken()

public String getRefreshToken()

OAuth 2.0 refresh token

Returns: java.lang.String

getRequestUrl()

public String getRequestUrl()

The url to obtain access token.

Returns: java.lang.String

getUseBasicAuthorization()

public boolean getUseBasicAuthorization()

Gets or sets value which indicates whether basic authorization is used

Returns: boolean

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

setLogin(String value)

public void setLogin(String value)

Gets or sets login for basic authorization

Parameters:

ParameterTypeDescription
valuejava.lang.String

setPassword(String value)

public void setPassword(String value)

Gets or sets password for basic authorization

Parameters:

ParameterTypeDescription
valuejava.lang.String

setUseBasicAuthorization(boolean value)

public void setUseBasicAuthorization(boolean value)

Gets or sets value which indicates whether basic authorization is used

Parameters:

ParameterTypeDescription
valueboolean

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int