Class TokenProvider
TokenProvider class
Class TokenProvider allows to retrieve access token for mail services.
public class TokenProvider : ITokenProvider
Properties
| Name | Description |
|---|
| virtual ClientId { get; } | The client ID obtained during application registration. |
| virtual ClientSecret { get; } | The client secret obtained during application registration. |
| virtual ExtraParameters { get; } | Gets extra parameters for request |
| virtual Login { get; set; } | Gets or sets login for basic authorization |
| virtual Password { get; set; } | Gets or sets password for basic authorization |
| virtual RefreshToken { get; } | OAuth 2.0 refresh token |
| virtual RequestUrl { get; } | The url to obtain access token. |
| virtual UseBasicAuthorization { get; set; } | Gets or sets value which indicates whether basic authorization is used |
Methods
| Name | Description |
|---|
| static GetInstance(string, string, string, string) | Gets an instance of the OutlookTokenProvider for defined parameters. |
| virtual Dispose() | Performs releasing resources. |
| virtual 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. |
| virtual GetAccessToken(bool) | Gets oAuth access token. |
Other Members
| Name | Description |
|---|
| static class Google | Provides an instance of the TokenProvider for Google mail server |
| static class Outlook | Provides an instance of the TokenProvider for Outlook mail server |
See Also