andyedinborough / aenetmail

C# POP/IMAP Mail Client
370 stars 153 forks source link

Added support for OAuth login #67

Closed robitar closed 12 years ago

robitar commented 12 years ago

Tested against gmail successfully, supply the xoauth base64 string as the 'password' argument to the ImapClient constructor, and specify ImapClient.AuthMethods.SaslOAuth.

meehi commented 12 years ago

Hi,

what is the difference between normal Login and SaslOAuth? You can use both to login to Gmail.

robitar commented 12 years ago

Login requires the user to give you their Google account password.

meehi commented 12 years ago

So SaslOAuth doesn't requires it? How does it make authentication then?

robitar commented 12 years ago

Google for oauth and you'll see how it works, the basic idea is that you redirect the user to google/facebook etc, where they sign in securely, then you get back a token which lets you access the users data.

meehi commented 12 years ago

I see.

Is this something that Gmail notifier uses also?

robitar commented 12 years ago

I cant say for sure by my guess is that all Google services support oauth.

robitar commented 12 years ago

Any chance of getting this pulled so I can go back to using the nuget package?

andyedinborough commented 12 years ago

Sorry for the delay! I'm about to push up 1.6.1-rc to Nuget.

robitar commented 12 years ago

Awesome! cheers.

cgonsalves13 commented 12 years ago

Hi, I am using DotNetOpenAuth for generate oauth token for gmail,but when i use it against ae.net login method using 'SaslOAuth' it gives me error "xm001 BAD Invalid arguments supplied to AUTHENTICATE",

Is there any recommended method to get oauth token from gmail?i want a persistent oauth token which i can store for a particular user to access his/her gmail instead for storing passwords.

robitar commented 12 years ago

I had a lot of hassle trying to use DotNetOpenAuth so I ended up just rolling my own implementation to get the auth token, based on the phython script in the Google code samples

andyedinborough commented 12 years ago

cough https://github.com/andyedinborough/oyauth ;]

robitar commented 12 years ago

Now how come I missed that? d'oh!

cgonsalves13 commented 12 years ago

Which version of OAUTH you tested? 1.0 or 2.0?

robitar commented 12 years ago

I think Google imap only supports 1.0 at this stage.

cgonsalves13 commented 12 years ago

have you tested oyauth ? coz its not working for me,giving error "xm001 BAD Invalid arguments supplied to AUTHENTICATE"

robitar commented 12 years ago

IMAP gives you no information on why the auth failed, so I would start testing with trying to access some other scope like the users email, and make sure that all the oauth machinery is working, if that fails it gives you back more information on what went wrong.

dotAge commented 11 years ago

Any progress? xm002 NO Invalid SASL argument. c3if23689282ibq.32!!!