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
 Provides an instance of the TokenProvider for Google mail server More...
 
class  Outlook
 Provides an instance of the TokenProvider for Outlook mail server More...
 

Public Member Functions

virtual bool get_UseBasicAuthorization ()
 Gets value which indicates whether basic authorization is used More...
 
virtual void set_UseBasicAuthorization (bool value)
 Sets value which indicates whether basic authorization is used More...
 
virtual System::String get_Login ()
 Gets login for basic authorization More...
 
virtual void set_Login (System::String value)
 Sets login for basic authorization More...
 
virtual System::String get_Password ()
 Gets password for basic authorization More...
 
virtual void set_Password (System::String value)
 Sets password for basic authorization More...
 
virtual System::String get_RequestUrl ()
 The url to obtain access token. More...
 
virtual System::ArrayPtr< System::Collections::Generic::KeyValuePair< System::String, System::String > > get_ExtraParameters ()
 Gets extra parameters for request More...
 
virtual System::String get_ClientId ()
 The client ID obtained during application registration. More...
 
virtual System::String get_ClientSecret ()
 The client secret obtained during application registration. More...
 
virtual System::String get_RefreshToken ()
 OAuth 2.0 refresh token More...
 
 TokenProvider (System::String requestUrl, System::String clientId, System::String clientSecret, System::String refreshToken)
 Initializes a new instance of the TokenProvider class More...
 
 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...
 
 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...
 
 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...
 
void Dispose () override
 Performs releasing resources. More...
 
System::SharedPtr< OAuthTokenGetAccessToken () override
 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...
 
System::SharedPtr< OAuthTokenGetAccessToken (bool ignoreExistingToken) override
 Gets oAuth access token. More...
 
virtual System::SharedPtr< OAuthTokengetAccessToken ()
 Gets oAuth access token. More...
 

Static Public Member Functions

static 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::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::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::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::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()

void Aspose::Email::Clients::TokenProvider::Dispose ( )
override

Performs releasing resources.

◆ get_ClientId()

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

The client ID obtained during application registration.

◆ get_ClientSecret()

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

The client secret obtained during application registration.

◆ get_ExtraParameters()

virtual 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 System::String Aspose::Email::Clients::TokenProvider::get_Login ( )
virtual

Gets login for basic authorization

◆ get_Password()

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

Gets password for basic authorization

◆ get_RefreshToken()

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

OAuth 2.0 refresh token

◆ get_RequestUrl()

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

The url to obtain access token.

◆ get_UseBasicAuthorization()

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

Gets value which indicates whether basic authorization is used

◆ getAccessToken()

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

Gets oAuth access token.

Returns
Returns oAuth access token

◆ GetAccessToken() [1/2]

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

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]

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

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.

◆ GetInstance()

static 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 void Aspose::Email::Clients::TokenProvider::set_Login ( System::String  value)
virtual

Sets login for basic authorization

◆ set_Password()

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

Sets password for basic authorization

◆ set_UseBasicAuthorization()

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

Sets value which indicates whether basic authorization is used