Always “Have Offline Access” | Google OAuth 2

后端 未结 5 2161
忘掉有多难
忘掉有多难 2021-02-09 02:59

I am trying to get fetch user\'s profile using Google OAuth2 api. After user authentication, on the consent page, I am always asked for \"Have Offline Access\"

The URL i

5条回答
  •  被撕碎了的回忆
    2021-02-09 03:29

    There are two parameters which can cause this prompt:

    • access_type (if it is 'offline', get refresh token)
    • approval_prompt (if it is 'force')

    A reference about this can be found here.

    Try to change the approval_prompt parameter to 'auto' or add it to your request and check the access_type parameter to 'online' or add it to your request.

提交回复
热议问题