Reputation: 21
To can consume Gmail api, application needs to be authorized by the owner of the gmail account, providing his consent:
https://developers.google.com/gmail/api/auth/about-auth
My question is: is there any way to avoid ask the user for his consent? My aim is get the credentials to use Gmail Api just using username / password of target gmail account.
Upvotes: 1
Views: 112
Reputation: 3162
To rephrase the question: "How can I bypass the whole process of 2 factor authorization?"
Answer: "Please do let us know if you manage it ... or report it to Google for a bug bounty, 'cause you're not supposed to be able to do so."
Upvotes: 0
Reputation: 193
Do you mean you want your application to store the username and password and then use them to access user data? If so, then no, you must obtain authorization from the user (at least once) in order to use the API. And it's a good thing, too, for the sake of security!
Or, do you mean that you're just trying to access your own account? Even then, you need to authorize yourself, because Google doesn't know who is running your code.
Is there a reason you don't want to go through the authorization process? Knowing that might provide some insight into your question for anyone who tries to answer it.
Upvotes: 1