GMail API: Authentication required twice
I'm running a app on Google App Engine which connects to the GMail API. In general this all works fine, however I have noticed that if I start a completely new session, the authorization is asking for authorization twice. Once from Google App Engine (see image below), and once through the regular Consent Screen as I would expect. What is initiating the first authorization and is there any way I can get rid of it?
My code for authorization:
decorator = OAuth2Decorator(client_id=settings.CLIENT_ID, client_secret=settings.CLIENT_SECRET, scope=settings.SCOPE) class gmailAuth(webapp2.RequestHandler): @decorator.oauth_aware def get(self): if decorator.has_credentials(): self.response.out.write('success') else: self.redirect(decorator.authorize_url())
I've figured out that the @decorator.oauth_aware refers to the Google Account API, which I am not using. This is what is causing the screen to appear. That means that since I am using webapp2 authentication, I will have to refer to the non-GAE specific API authentication.