- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
旧的 Chilkat 论坛似乎已经搬到了这里。
多年来,我一直让 Chilkat 的 OAuth1 与 Xero(来自 Xojo)集成得很好。现在 Xero 正在用 OAuth2 替换 OAuth1。
Xero 表示,一旦您成功连接了 3-legged OAuth2,您就可以使用刷新 token 继续重新连接,而无需每次都经过 3-legged 过程(即用户同意允许您的连接)。因此,一旦您完成了 3-legged 一次,您就不需要再做一次:每个未使用的 Refresh token 的有效期为 60 天(但只能使用一次)。
所以这个过程似乎是:
最佳答案
感谢您的评论。我现在已经完成了这项工作,所以我将我的答案发布给任何有同样问题的人。
在 Xero Developer 中链接您使用 oauth2 的应用程序后,oauth2 的第一步是“3-legged”步骤,您必须获得用户的批准。我一直无法获得 Chilkat example工作(不允许重定向)。但是,由于您通常只需要执行一次,因此只需使用 xoauth Terminal script Xero provide 就很容易了。 .基本上你只是:
// Set up the Authorisation:
Dim oauth2 As New Chilkat.OAuth2
'Set up from saved data:
oauth2.ClientId = { Client id used in initial setup }
oauth2.AccessToken = { access_token retrieved in setup }
oauth2.RefreshToken = { refresh_token: first retrieved in setup, then from each refresh }
oauth2.TokenEndpoint = "https://identity.xero.com/connect/token"
yourTenantID = { the <OrganisationID> of the <Organisation> you will be connecting to }
Dim success As Boolean
Dim rest As Chilkat.Rest
rest.Authorization = "Bearer " + oauth2.AccessToken
success = rest.AddHeader( "xero-tenant-id", yourTenantID)
'Responses will be in json: if you want xml, add this:
success = rest.AddHeader( "accept", "application/xml" )
其余对象现在已准备好用于与 Xero 交互。例如。获取一些数据:
// Get some data:
'endpoint is the endpoint you want, e.g. "Accounts"
'identifier and condition are optional parameters, see Xero's API Previewer
Dim sbPath As New Chilkat.StringBuilder
success = sbPath.Append( "/api.xro/2.0/" + endpoint )
if success then
if identifier>"" then
success = sbPath.Append("/" + identifier)
elseif condition>"" then
success = rest.AddQueryParam( "where" ,condition )
end if
end if
if not success then return rest.LastErrorText
// Get the full or matching list:
Dim sbXml As New Chilkat.StringBuilder
success = rest.FullRequestNoBodySb( "GET", sbPath.GetAsString(), sbXml)
dim statuscode As Integer = rest.ResponseStatusCode
if statuscode = 401 then
'access code expired: use refresh token to revive it and get new refresh token
success = oauth2.RefreshAccessToken()
if success then
{ Save the new oauth2.RefreshToken }
{ Disconnect and reconnect rest }
success = rest.FullRequestNoBodySb( "GET", sbPath.GetAsString(), sbXml)
end if
end if
if success then
If (rest.ResponseStatusCode <> 200) Then // A 200 response is expected for actual success
return sbXml.GetAsString()
else // get the response, in this case XML
Dim bAutoTrim As Boolean = True
success = xml.LoadSb(sbXml,bAutoTrim)
end if
end if
if not success then return rest.LastErrorText
关于oauth-2.0 - 使用 Xojo 和 Chilkat 与 Xero 集成 OAuth2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63297483/
我有一个 webapp,它使用 php 服务器和数据库服务器执行大量 ajax 请求。我还创建了一个 iPhone 应用程序和一个 Android 应用程序,直到现在它们一直作为离线应用程序工作。 现
OAuth 的访问 token /刷新 token 流对我来说似乎非常不安全。帮助我更好地理解它。 假设我正在与利用 OAuth 的 API 集成(如 this one )。我有我的访问 token
这个问题在这里已经有了答案: 9年前关闭。 Possible Duplicate: How is oauth 2 different from oauth 1 我知道这两个不向后兼容。但是,既然已经实
我已经看到关于此的其他问题( here 、 here 和 here ),但我对任何解决方案都不满意,所以我再次询问。我正在启动一个 Web 应用程序,它将利用来自多个提供商(Google、Facebo
我知道(在 OAuth 中使用授权代码“授权代码”时),访问 token 的生命周期应该很短,但刷新 token 的生命周期可能很长。 所以我决定为我的项目: 访问 token 生命周期:1 天 刷新
在没有浏览器的情况下,我们可以在手机上的应用程序中使用 OAuth 吗? 如果没有浏览器,用户是否仍然可以批准 token 请求(以便消费者可以继续从服务提供者那里获取 protected 资源)?
用非常简单的术语来说,有人可以解释一下 OAuth 2 和 OAuth 1 之间的区别吗? OAuth 1 现在已经过时了吗?我们应该实现 OAuth 2 吗?我没有看到很多 OAuth 2 的实现;
修改表单例份验证登录过程并不难,因此除了正常的表单例份验证之外,WebClient 对象对由使用 Thinktecture IdentityModel 设置的 Web Api DAL 提供的 api/
我想连接到 LinkedIn 并通过他们的 API 提取一些信息。 LinkedIn API 使用 OAuth 2.0。 我读过的所有关于 OAuth 的文档(无论是在 LinkedIn 的上下文中还
OAuth 与其他身份验证标准的支持范围有多广? 这可能是社区维基的东西,但我还是要问。 我需要投资一些与服务器身份验证相关的东西,而且那里似乎有一些不错的东西。 最佳答案 OAuth 主要用作授权机
我有几个问题... 雅虎和微软 api 是否支持 oAuth 2.0? 如果是,那么主要是什么 应该采取的安全措施 转移时受到照顾 oAuth 1.0 到 oAuth 2.0。 Google API
我已经用谷歌 oAuth 开发了一个应用程序,这工作正常。 我可以登录并访问我的网站。 我的问题是,当我从我的应用程序中注销(注销)时,我删除了所有 session ,但未删除经过身份验证的 cook
我在 Internet 上寻找一些关于此的信息,最后在 RFC 上找到了 Oauth 1.0 协议(protocol):https://www.rfc-editor.org/rfc/rfc5849 您
我正在尝试制作 Google OpenID/OAuth hybrid签到工作。问题是它是一个可安装的网络(所以没有固定域),我也试图让它在我的开发机器上工作 - 所以返回 URL 类似于 http:/
我想构建一个独立与任何身份提供者(如 ADFS、OpenAM、oracle 身份)一起工作的应用程序。我的目的是验证来自任何一个 IDP 的登录用户,这些 IDP 配置为实现我的 SSO。 我不确定
我正在深入研究 Spring OAuth,发现一些相互矛盾的信息。 具体来说,this tutorial声明 /oauth/token 端点在将刷新 token 授予客户端应用程序之前处理用户名和密码
如何通过自定义命令行工具支持三足式 OAuth 工作流? 我想允许我的 CLI 工具的用户上网、登录并在本地缓存 token ,类似于 heroku login。正在做。 最佳答案 你必须扔掉同意屏幕
什么是 oauth 域?是否有任何免费的 oauth 服务?我可以将它用于 StackApps registration 吗? ?我在谷歌上搜索了很多,但找不到答案。 最佳答案 这是redirect_
我需要将我的 Delicious 书签下载到非 Web 应用程序,而无需持续的用户交互。我正在使用 Delicious 的 V2 API(使用 oAuth),但问题是他们的访问 token 似乎在一小
我正在尝试为两台服务器设置一个 nginx 负载均衡器/代理,并在两台服务器上运行 OAuth 身份验证的应用程序。 当 nginx 在端口 80 上运行时,一切都运行良好,但是当我将它放在任何其他端
我是一名优秀的程序员,十分优秀!