从Google API获取刷新令牌

编程入门 行业动态 更新时间:2024-10-27 15:22:28
本文介绍了从Google API获取刷新令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我浏览了其他帖子,但未得到答复(已停止从Google的API获取刷新令牌),或者似乎不再纠正。

I've looked through other posts and they're either unanswered (Stopped getting refresh token from google's API) or no longer correct it seems.

我正在尝试从Google api获取新的刷新令牌,我具有access_type ='offline'和rovaling_prompt ='force',但我返回的响应不包含刷新令牌。我浏览过的其他帖子说,拥有这两个参数应该会给我返回刷新令牌。

I am trying to get a new refresh token from the google api, I have access_type = 'offline' and approval_prompt = 'force' but the response I'm getting back does not contain a refresh token. The other posts I have looked through says that having those two parameters should return me a refresh token.

有任何想法吗?

编辑:我在想也许我可以撤消auth并让用户重新进行身份验证以获取新的refresh_token。会行得通吗/是否有更好的解决方案?

I was thinking perhaps I could revoke the auth and have the user re-auth to get a fresh refresh_token. Would this work/is there a better solution?

推荐答案

我想我已经解决了,而不是使用rovaling_prompt = force,您可以使用:

I think I figured it out, instead of using approval_prompt=force you can use:

{ ... access_type='offline', prompt='select_account consent' }

强制执行新的批准屏幕并获取新的刷新令牌

to force a new approval screen and get a new refresh token.

更多推荐

从Google API获取刷新令牌

本文发布于:2023-11-26 15:36:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634288.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:令牌   Google   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!