简体   繁体   中英

Google OAuth with username and password

I want to create Gmail email client in PHP similar to android/ios application where user fill username and password and perform operations like send/retrieve emails. I am already done with the Oauth - Web server applications where google provide access and refresh token to authenticate the user account. But I don't want user to be prompted for giving prevision to my application.

I checked something known as 2-factor authentication.Please let me know how is this possible ?

This is not possible with new Google authentication APIs as user's giving out their Google password to random developers/applications is considered a security risk http://googledevelopers.blogspot.com/2012/04/changes-to-deprecation-policies-and-api.html . Use oauth2 with a web flow and have the user authorize it. Then they don't have to expose their password and can always go and revoke the oauth2 grant if they want.

You can try creating a service account. It doesnt require that the user enter his/hers password.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM