我能够成功地使用第三方OAuth2提供程序(Xero)授权我的应用程序,但无法自动刷新令牌,也无法手动刷新令牌。
文档表明,authlib可以自动完成这一任务。我尝试了来自Authlib文档的两种不同的方法,它们在上给出了一个“通过信号自动更新令牌”的示例,以及在上注册了一个"update_token“函数。
使用这两种方法,永远不会尝试刷新令牌,请求将使用过期的令牌传递给Xero,我将收到一个错误,而继续的唯一方法是使用Xero手动重新授权应用程序。
以下是web客户端文档中"update_token“方法的相关代码:
#this never ends up getting
我想连接到Xero API,我有以下代码:
using Xero.Api;
using Xero.Api.Core;
using Xero.Api.Example.Applications.Public;
using Xero.Api.Infrastructure.OAuth;
using Xero.Api.Infrastructure.Interfaces;
using Xero.Api.Serialization;
var public_app_api = new XeroCoreApi("https://api.xero.com", new PublicAuthenti
我刚刚开始使用oauth2和xero (使用.net) 我已经按照文档运行了独家新闻安装,授予类型为'authorization_code',作用域为'd',这给了我访问和刷新令牌。 现在,当运行示例项目XeroNetStandardApp时,在替换了客户端id、密钥、回调uri和令牌之后,当我在检索新令牌后尝试执行任何操作时,都会得到401。 令牌刷新似乎工作正常。如果我使用持有者调用https://api.xero.com/connections,我会得到so, no elements in the response,所以我假设这是某种类型的用户身份验证错
大家好,我是新手,正在使用这个库,这似乎是使用auth 2.0的一个很好的解决方案。我正在尝试生成可以接收的刷新令牌。下面是我的代码:
OAuth2\Autoloader::register();
// $dsn is the Data Source Name for your database, for exmaple "mysql:dbname=my_oauth2_db;host=localhost"
$storage = new OAuth2\Storage\Pdo(array('dsn' => $this->dsn,