Class SaslOAuth2Token
An OAuth 2.0 access token for SASL authentication via the XOAUTH2 mechanism. Immutable. Used by Gmail and Office 365 across SMTP, POP3, and IMAP.
Inherited Members
Namespace: DRIT.Mail.Rfc.Sasl
Assembly: DRIT.Mail.dll
Syntax
public class SaslOAuth2Token
Remarks
The library does not obtain OAuth tokens. The caller acquires the token (via MSAL.NET, Google.Apis.Auth, etc.) and passes it in. This keeps the library dependency-free.
Constructors
View SourceSaslOAuth2Token(string, string)
Initializes a new instance of the SaslOAuth2Token class.
Declaration
public SaslOAuth2Token(string userName, string accessToken)
Parameters
| Type | Name | Description |
|---|---|---|
| string | userName | The user name (email address) associated with the token. |
| string | accessToken | The OAuth 2.0 access token. |
Remarks
The library does not obtain OAuth tokens. The caller acquires the token (via MSAL.NET, Google.Apis.Auth, etc.) and passes it in. This keeps the library dependency-free.
Properties
View SourceAccessToken
Gets the OAuth 2.0 access token.
Declaration
public string AccessToken { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
The library does not obtain OAuth tokens. The caller acquires the token (via MSAL.NET, Google.Apis.Auth, etc.) and passes it in. This keeps the library dependency-free.
UserName
Gets the user name (email address) associated with the token.
Declaration
public string UserName { get; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
The library does not obtain OAuth tokens. The caller acquires the token (via MSAL.NET, Google.Apis.Auth, etc.) and passes it in. This keeps the library dependency-free.