Question

I am working with the Google Drive API for a project. When obtaining the access token through the Though the OAuth 2.0 implementation Google Drive is providing the user needs to grant access though a web interface by login into his/her account and allowing access for my application. IS there anyway i can obtain the access token without the user having to allow access through the web page.

For example is it possible to get the access token by directly providing the username and password of the user. any help on this will be appreciated.

Was it helpful?

Solution

One of the reasons why providers such as Google use OAuth is that the user is never required to provide his username and password to a third party. He only has to input it directly on the provider's website.

The OAuth 2 standard itself would even provide such a method, called the Resource Owner Password Credentials grant, but that is not implemented by Google for security reasons.

If you only need access from your web server to your own account, you can use Service Accounts.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top