AuthType Property  
 

Gets and sets the method used to authenticate the user.

Syntax

object.AuthType [= type ]

Remarks

The AuthType property specifies the type of authentication that should be used when the client connects to the mail server. The following authentication methods are supported:

Value Constant Description
0 imapAuthLogin This authentication type will use the LOGIN method to authenticate the client session. This encodes the username and password in a specific format, but the credentials are not encrypted. It should be used over a secure connection. The server must support the Simple Authentication and Security Layer (SASL) mechanism as defined in RFC 4422.
1 imapAuthPlain This authentication type will use the PLAIN method to authenticate the client session. This encodes the username and password in a specific format, but the credentials are not encrypted. It should be used over a secure connection. The server must support the PLAIN Simple Authentication and Security Layer (SASL) mechanism as defined in RFC 4616.
4 imapAuthXOAuth2 This authentication type will use the XOAUTH2 method to authenticate the client session. This authentication method does not require the user password, instead the BearerToken property must specify the OAuth 2.0 bearer token issued by the service provider.
5 imapAuthBearer This authentication type will use the OAUTHBEARER method to authenticate the client session as defined in RFC 7628. This authentication method does not require the user password, instead the BearerToken property must specify the OAuth 2.0 access token issued by the service provider.

Data Type

Integer (Int32)

Remarks

The imapAuthXOAuth2 and imapAuthBearer authentication methods are similar, but they are not interchangeable. Both use an OAuth 2.0 bearer token to authenticate the client session, but they differ in how the token is presented to the server. It is currently preferable to use the XOAUTH2 method because it is more widely available and some service providers do not yet support the OAUTHBEARER method.

Changing the value of the BearerToken property will automatically set the current authentication method to use OAuth 2.0.

See Also

BearerToken Property, Password Property, UserName Property, Connect Method