Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

oauth support #70

Closed
benbro opened this issue Aug 6, 2014 · 4 comments · Fixed by #76
Closed

oauth support #70

benbro opened this issue Aug 6, 2014 · 4 comments · Fixed by #76

Comments

@benbro
Copy link
Contributor

benbro commented Aug 6, 2014

Is there a chance for oauth support when connecting to SMTP servers?
https://developers.google.com/gmail/oauth_overview
https://developers.google.com/gmail/xoauth2_protocol
2-legged auth
https://developers.google.com/gmail/oauth_protocol

Erlang oauth 2.0 client
https://github.com/kivra/oauth2_client

I currently need to save the email password in plain text in the Erlang code.
It can be much more secure if I'll be able to use an oauth token.

Thanks

@seriyps
Copy link
Collaborator

seriyps commented Aug 6, 2014

Looks like it's not possible to implement OAuth without hacking on gen_smtp code near there https://github.com/Vagabond/gen_smtp/blob/8f7ba01172e679e8b4262334cefc3451b4c36777/src/gen_smtp_server_session.erl#L344-L373

But for now, you always can store your auth data, like logins/passwords in, say, database, instead of plain text in erlang code.

@benbro
Copy link
Contributor Author

benbro commented Aug 6, 2014

I'm trying to avoid storing the real password on the server at all.

So we can add a <<"XOAUTH">> here?
https://github.com/Vagabond/gen_smtp/blob/8f7ba01172e679e8b4262334cefc3451b4c36777/src/gen_smtp_server_session.erl#L344-L373

@Vagabond
Copy link
Collaborator

Vagabond commented Aug 6, 2014

Yeah, if you added XOAUTH there you could implement your oauth stuff in a custom handle_AUTH handler:

https://github.com/Vagabond/gen_smtp/blob/master/src/smtp_server_example.erl#L188

You could probably also make it more pluggable, so modifying server_session was not needed for future auth types.

@hachreak
Copy link

👍
I encountered that problem with Gmail.. T_T
I resolved the option to permit the login from "less secure" application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants