Aspose::Email::Clients::TokenProvider Class Reference

Class TokenProvider allows to retrieve access token for mail services. More...

Inherits Aspose::Email::Clients::ITokenProvider.

Classes

class  Google
 
class  Outlook
 

Public Member Functions

virtual ASPOSE_EMAIL_SHARED_API bool get_UseBasicAuthorization ()
 Gets value which indicates whether basic authorization is used More...
 
virtual ASPOSE_EMAIL_SHARED_API void set_UseBasicAuthorization (bool value)
 Sets value which indicates whether basic authorization is used More...
 
virtual ASPOSE_EMAIL_SHARED_API System::String get_Login ()
 Gets login for basic authorization More...
 
virtual ASPOSE_EMAIL_SHARED_API void set_Login (System::String value)
 Sets login for basic authorization More...
 
virtual ASPOSE_EMAIL_SHARED_API System::String get_Password ()
 Gets password for basic authorization More...
 
virtual ASPOSE_EMAIL_SHARED_API void set_Password (System::String value)
 Sets password for basic authorization More...
 
virtual ASPOSE_EMAIL_SHARED_API System::String get_RequestUrl ()
 The url to obtain access token. More...
 
virtual ASPOSE_EMAIL_SHARED_API System::ArrayPtr< System::Collections::Generic::KeyValuePair< System::String, System::String > > get_ExtraParameters ()
 Gets extra parameters for request More...
 
virtual ASPOSE_EMAIL_SHARED_API System::String get_ClientId ()
 The client ID obtained during application registration. More...
 
virtual ASPOSE_EMAIL_SHARED_API System::String get_ClientSecret ()
 The client secret obtained during application registration. More...
 
virtual ASPOSE_EMAIL_SHARED_API System::String get_RefreshToken ()
 OAuth 2.0 refresh token More...
 
ASPOSE_EMAIL_SHARED_API TokenProvider (System::String requestUrl, System::String clientId, System::String clientSecret, System::String refreshToken)
 Initializes a new instance of the TokenProvider class More...
 
ASPOSE_EMAIL_SHARED_API TokenProvider (System::String requestUrl, System::String clientId, System::String clientSecret, System::String refreshToken, System::String login, System::String password)
 Initializes a new instance of the TokenProvider class More...
 
ASPOSE_EMAIL_SHARED_API TokenProvider (System::String requestUrl, System::String clientId, System::String clientSecret, System::String refreshToken, System::String login, System::String password, System::ArrayPtr< System::Collections::Generic::KeyValuePair< System::String, System::String >> extraParameters)
 Initializes a new instance of the TokenProvider class More...
 
ASPOSE_EMAIL_SHARED_API TokenProvider (System::String requestUrl, System::String clientId, System::String clientSecret, System::String refreshToken, System::ArrayPtr< System::Collections::Generic::KeyValuePair< System::String, System::String >> extraParameters)
 Initializes a new instance of the TokenProvider class More...
 
virtual ASPOSE_EMAIL_SHARED_API void Dispose ()
 Performs releasing resources. More...
 
virtual ASPOSE_EMAIL_SHARED_API System::SharedPtr< OAuthTokenGetAccessToken ()
 Gets oAuth access token. If token exists and its expiration date is not expired returns current token, otherwise requests new token from a server. More...
 
virtual ASPOSE_EMAIL_SHARED_API System::SharedPtr< OAuthTokenGetAccessToken (bool ignoreExistingToken)
 Gets oAuth access token. More...
 
virtual ASPOSE_EMAIL_SHARED_API System::SharedPtr< OAuthTokengetAccessToken ()
 Gets oAuth access token. More...
 

Static Public Member Functions

static ASPOSE_EMAIL_SHARED_API System::SharedPtr< TokenProviderGetInstance (System::String requestUrl, System::String clientId, System::String clientSecret, System::String refreshToken)
 Gets an instance of the OutlookTokenProvider for defined parameters. More...
 

Detailed Description

Class TokenProvider allows to retrieve access token for mail services.

Constructor & Destructor Documentation

◆ TokenProvider() [1/4]

ASPOSE_EMAIL_SHARED_API Aspose::Email::Clients::TokenProvider::TokenProvider ( System::String  requestUrl,
System::String  clientId,
System::String  clientSecret,
System::String  refreshToken 
)

Initializes a new instance of the TokenProvider class

Parameters
requestUrlThe url to obtain access token.
clientIdThe client ID obtained from the Microsoft account Developer Center during application registration.
clientSecretThe client secret obtained during application registration.
refreshTokenOAuth 2.0 refresh token

◆ TokenProvider() [2/4]

ASPOSE_EMAIL_SHARED_API Aspose::Email::Clients::TokenProvider::TokenProvider ( System::String  requestUrl,
System::String  clientId,
System::String  clientSecret,
System::String  refreshToken,
System::String  login,
System::String  password 
)

Initializes a new instance of the TokenProvider class

Parameters
requestUrlThe url to obtain access token.
clientIdThe client ID obtained from the Microsoft account Developer Center during application registration.
clientSecretThe client secret obtained during application registration.
refreshTokenOAuth 2.0 refresh token
loginlogin for basic authorization
passwordpassword for basic authorization

◆ TokenProvider() [3/4]

ASPOSE_EMAIL_SHARED_API Aspose::Email::Clients::TokenProvider::TokenProvider ( System::String  requestUrl,
System::String  clientId,
System::String  clientSecret,
System::String  refreshToken,
System::String  login,
System::String  password,
System::ArrayPtr< System::Collections::Generic::KeyValuePair< System::String, System::String >>  extraParameters 
)

Initializes a new instance of the TokenProvider class

Parameters
requestUrlThe url to obtain access token.
clientIdThe client ID obtained from the Microsoft account Developer Center during application registration.
clientSecretThe client secret obtained during application registration.
refreshTokenOAuth 2.0 refresh token
loginlogin for basic authorization
passwordpassword for basic authorization
extraParameters

◆ TokenProvider() [4/4]

ASPOSE_EMAIL_SHARED_API Aspose::Email::Clients::TokenProvider::TokenProvider ( System::String  requestUrl,
System::String  clientId,
System::String  clientSecret,
System::String  refreshToken,
System::ArrayPtr< System::Collections::Generic::KeyValuePair< System::String, System::String >>  extraParameters 
)

Initializes a new instance of the TokenProvider class

Parameters
requestUrlThe url to obtain access token.
clientIdThe client ID obtained from the Microsoft account Developer Center during application registration.
clientSecretThe client secret obtained during application registration.
refreshTokenOAuth 2.0 refresh token
extraParameters

Member Function Documentation

◆ Dispose()

virtual ASPOSE_EMAIL_SHARED_API void Aspose::Email::Clients::TokenProvider::Dispose ( )
virtual

Performs releasing resources.

◆ get_ClientId()

virtual ASPOSE_EMAIL_SHARED_API System::String Aspose::Email::Clients::TokenProvider::get_ClientId ( )
virtual

The client ID obtained during application registration.

◆ get_ClientSecret()

virtual ASPOSE_EMAIL_SHARED_API System::String Aspose::Email::Clients::TokenProvider::get_ClientSecret ( )
virtual

The client secret obtained during application registration.

◆ get_ExtraParameters()

virtual ASPOSE_EMAIL_SHARED_API System::ArrayPtr<System::Collections::Generic::KeyValuePair<System::String, System::String> > Aspose::Email::Clients::TokenProvider::get_ExtraParameters ( )
virtual

Gets extra parameters for request

◆ get_Login()

virtual ASPOSE_EMAIL_SHARED_API System::String Aspose::Email::Clients::TokenProvider::get_Login ( )
virtual

Gets login for basic authorization

◆ get_Password()

virtual ASPOSE_EMAIL_SHARED_API System::String Aspose::Email::Clients::TokenProvider::get_Password ( )
virtual

Gets password for basic authorization

◆ get_RefreshToken()

virtual ASPOSE_EMAIL_SHARED_API System::String Aspose::Email::Clients::TokenProvider::get_RefreshToken ( )
virtual

OAuth 2.0 refresh token

◆ get_RequestUrl()

virtual ASPOSE_EMAIL_SHARED_API System::String Aspose::Email::Clients::TokenProvider::get_RequestUrl ( )
virtual

The url to obtain access token.

◆ get_UseBasicAuthorization()

virtual ASPOSE_EMAIL_SHARED_API bool Aspose::Email::Clients::TokenProvider::get_UseBasicAuthorization ( )
virtual

Gets value which indicates whether basic authorization is used

◆ GetAccessToken() [1/2]

virtual ASPOSE_EMAIL_SHARED_API System::SharedPtr<OAuthToken> Aspose::Email::Clients::TokenProvider::GetAccessToken ( )
virtual

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
Returns oAuth access token

Implements Aspose::Email::Clients::ITokenProvider.

◆ GetAccessToken() [2/2]

virtual ASPOSE_EMAIL_SHARED_API System::SharedPtr<OAuthToken> Aspose::Email::Clients::TokenProvider::GetAccessToken ( bool  ignoreExistingToken)
virtual

Gets oAuth access token.

Parameters
ignoreExistingTokenIf 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
Returns oAuth access token

Implements Aspose::Email::Clients::ITokenProvider.

◆ getAccessToken()

virtual ASPOSE_EMAIL_SHARED_API System::SharedPtr<OAuthToken> Aspose::Email::Clients::TokenProvider::getAccessToken ( )
virtual

Gets oAuth access token.

Returns
Returns oAuth access token

◆ GetInstance()

static ASPOSE_EMAIL_SHARED_API System::SharedPtr<TokenProvider> Aspose::Email::Clients::TokenProvider::GetInstance ( System::String  requestUrl,
System::String  clientId,
System::String  clientSecret,
System::String  refreshToken 
)
static

Gets an instance of the OutlookTokenProvider for defined parameters.

Parameters
requestUrlThe url to obtain access token.
clientIdThe client ID obtained from the Microsoft account Developer Center during application registration.
clientSecretThe client secret obtained during application registration.
refreshTokenOAuth 2.0 refresh token
Returns
Returns an instance of the OutlookTokenProvider for defined parameters.

◆ set_Login()

virtual ASPOSE_EMAIL_SHARED_API void Aspose::Email::Clients::TokenProvider::set_Login ( System::String  value)
virtual

Sets login for basic authorization

◆ set_Password()

virtual ASPOSE_EMAIL_SHARED_API void Aspose::Email::Clients::TokenProvider::set_Password ( System::String  value)
virtual

Sets password for basic authorization

◆ set_UseBasicAuthorization()

virtual ASPOSE_EMAIL_SHARED_API void Aspose::Email::Clients::TokenProvider::set_UseBasicAuthorization ( bool  value)
virtual

Sets value which indicates whether basic authorization is used