When is access_type = Online appropriate? :OAuth2 - Google API

前端 未结 1 1370
伪装坚强ぢ
伪装坚强ぢ 2021-02-08 04:36

When requesting OAuth credentials, I can specify the access_type to be Offline or Online.

Opting for the Online access type forces the users to approve access to my ap

相关标签:
1条回答
  • 2021-02-08 04:58

    There is one other parameter that comes into play in these flows and I suspect you're running into it. It's the approval_prompt parameter.

    When access_type=online you are also allowed to specify a value for approval_prompt. If it is set to approval_prompt=force, your user will always be prompted, even if they have already granted.

    On the other hand, when access_type=offline, approval_prompt can only be set to approval_prompt=force, but to make up for this restriction you're also provided a refresh_token which you can use to refresh your access token.

    Check the URL that your access_type=online is opening. Try setting approval_prompt=auto. The grant screen should only appear the first time.

    0 讨论(0)
提交回复
热议问题