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 popAuthPass The username and password is sent to the server using the USER and PASS commands. This authentication method is supported by most servers and is the default authentication type. The credentials are not encrypted and this method should only be used over secure connections.
1 popAuthApop The APOP authentication method which uses an MD5 digest of the password. This method has been deprecated is not supported by all servers. It should only be used if required by legacy mail servers which do not support the SASL authentication methods.
3 popAuthLogin This authentication type will use the AUTH LOGIN command 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.
4 popAuthPlain This authentication type will use the AUTH PLAIN command 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.
6 popAuthXOAuth2 This authentication type will use the AUTH XOAUTH2 command to authenticate the client session. This authentication method does not require the user password, instead the BearerToken property must specify the bearer token issued by the service provider.
7 popAuthBearer This authentication type will use the AUTH OAUTHBEARER command 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 bearer token issued by the service provider.

Data Type

Integer (Int32)

Remarks

The popAuthLogin and popAuthPlain authentication methods require the mail server support the Simple Authentication and Security Layer (SASL) AUTH command as defined in RFC 5034. Most modern mail servers do support one or both of these methods, and they are generally preferred over the popAuthPass method when possible. However, for backwards compatibility with legacy servers, the API will default to using popAuthPass for client authentication.

The popAuthXOAuth2 and popAuthBearer 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