You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Microsoft and Gmail are requiring Oauth2 authentication, it would make sense to allow that in this package. The user would be required to obtain the authentication token and pass it as the password. The following code works for office365:
/// <summary>
/// Authenticates a user towards the POP server using the Oauth2 commands
/// </summary>
/// <param name="username">The username</param>
/// <param name="password">The Oauth2 token</param>
/// <exception cref="PopServerException">If the server responded with -ERR</exception>
private void AuthenticateUsingOauth2(string username, string password)
{
string auth = "user=" + username + "\u0001auth=Bearer " + password + "\u0001\u0001";
string authToken = Convert.ToBase64String(System.Text.ASCIIEncoding.ASCII.GetBytes(auth));
SendCommand("AUTH XOAUTH2"); // + password);
SendCommand(authToken);
// Authentication was successful if no exceptions thrown before getting here
}
I just added a new Oauth2 authentication type. Unfortunately, it looks like Gmail has a slightly different syntax, so you might need a separate type for it.
This is not a bug, but it would extend the usefulness of OpenPop as email security becomes tighter.
The text was updated successfully, but these errors were encountered:
Since Microsoft and Gmail are requiring Oauth2 authentication, it would make sense to allow that in this package. The user would be required to obtain the authentication token and pass it as the password. The following code works for office365:
I just added a new Oauth2 authentication type. Unfortunately, it looks like Gmail has a slightly different syntax, so you might need a separate type for it.
This is not a bug, but it would extend the usefulness of OpenPop as email security becomes tighter.
The text was updated successfully, but these errors were encountered: