This is more secure and flexible approach than using login/password pair. - [Using OAuth 2.0 for Installed Applications](https://developers.google.com/accounts/docs/OAuth2InstalledApp) - [Using OAuth2 to access readonly Gmail feed](http://stackoverflow.com/questions/14202471/using-oauth2-to-access-readonly-gmail-feed)
This is more secure and flexible approach than using login/password pair.