bing ads quath2:如何从刷新令牌生成新的访问令牌? [英] bing ads quath2: how to generate new access token from refresh token?

查看:123
本文介绍了bing ads quath2:如何从刷新令牌生成新的访问令牌?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用bing ads API PHP平台从刷新令牌生成新的访问令牌?

how i can generate new access token from refresh token using bing ads API PHP platform?

我有访问令牌,但我没有找到任何示例如何生成新的访问令牌

I have the access token but i didn't find any example of how to generate new access token

请与我分享您的代码

推荐答案

您好。

如果您已有当前经过身份验证的用户的刷新令牌,则应使用"refresh_token"授权类型并使用刷新令牌请求新的访问令牌。请参阅

授权码授予流程
以获取有关授权流程的更多详细信息。虽然不建议在会话中存储刷新令牌,但类似于以下修改
PHP中的服务器端OAuth身份验证示例 (在OAuth2Callback.php中) 应该用于演示目的。在生产中你应该安全地存储刷新令牌,所以请
相应地修改样本。

If you already have a refresh token for the current authenticated user, you should use the 'refresh_token' grant type and request a new access token using the refresh token. Please see Authorization Code Grant Flow for more details on the grant flow. While it isn't recommended to store the refresh token in the session, something similar to the following modification to the Server Side OAuth Authentication in PHP example (in OAuth2Callback.php) should work for demo purposes. In production you should be storing the refresh token securely, so please modify the sample accordingly.

if(isset(


_SESSION ['refresh_token'])){
_SESSION['refresh_token'])){


accessTokenExchangeParams = array(
'client_id'=>
accessTokenExchangeParams = array( 'client_id' =>


这篇关于bing ads quath2:如何从刷新令牌生成新的访问令牌?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆