Вопрос

I have an application which requests that Google authorize it for basic profile and email permissions via Oauth1. If I clear all cookies and repeat the process, I am again prompted to authorize the application.

According to https://developers.google.com/accounts/docs/OAuth2Login:

If your repeat this process, you will not see the consent screen. Google remembers your consent, and simply issues a new access token to the site. If, for some reason, you'd like to reprompt the user for consent, you can add approval_prompt=force to the parameters in the request.

Am I being prompted because

  1. I'm using Oauth1 and not Oauth2?
  2. Some other reason (Maybe I haven't given enough information to tell why)

Note that stack overflow itself does not exhibit this behavior, so I know this should be possible.

Это было полезно?

Решение

You may be getting "prompted" for a couple of things. First, to enter your credentials to login. If you clear you cookies you will get prompted for your username and password. This will happen with OAuth 1 or 2. But to answer your question, we don't support auto-approvals for OAuth1 authorizations. You should hold on to your access token and should not have to re-prompt the user for continued API access.

This is where I add the standard disclaimer that if you should strongly consider using OAuth2 instead of OAuth1. We've deprecated OAuth1. OAuth 2 is easier to code and the user experience is much improved.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top