简体   繁体   English

在databasedotcom gem中使用多个访问令牌

[英]using multiple access tokens with databasedotcom gem

After having googled enough (and failing!) I thought of posting this question here. 用足够的谷歌搜索(失败!)后,我想到了在这里发布这个问题。 (Interestingly SO shows all matching questions before you start posting yours based on subject you use for your question. But no help :( (有趣的是,SO在根据您用于问题的主题开始发布您的问题之前会显示所有匹配的问题。但是没有帮助:(

Anyways my situation is: 无论如何我的情况是:

  1. authorize the rails app by logging to different Orgs and save the access_token (AT), refresh_token(RT) and instance_url(IU) received back.List item 通过登录到其他组织来授权Rails应用并保存回来的access_token(AT),refresh_token(RT)和instance_url(IU)。
  2. authenticate the databasedotcom (DBDC) gem client using different AT,RT & IU based on which user I want to access data for. 根据要访问其数据的用户,使用不同的AT,RT和IU对databasedotcom(DBDC)gem客户端进行身份验证。

BUT. 但。

After first authenticate using DBDC gem, if I try to authenticate using different AT,RT & IU for a different user and access data I still get data of the first authenticated user! 首次使用DBDC gem进行身份验证之后,如果我尝试对不同的用户使用不同的AT,RT和IU进行身份验证并访问数据,我仍然会获得第一个经过身份验证的用户的数据!

I tried looking in the code of DBDC gem, but maybe I am not really experienced enough, so I could not find any solution/traceback for this issue I am facing. 我尝试查看DBDC gem的代码,但是也许我没有足够的经验,所以我找不到遇到的这个问题的任何解决方案/回溯。

Any help/link/pointer on this will be highly appreciated! 任何对此的帮助/链接/指针将不胜感激!

PS: interestingly enough, there seems to be a concept of logout form oauth session. PS:有趣的是,似乎有一个退出表单oauth会话的概念。 Did not see it mentioned anywhere in docs, still struggling though. 在文档中的任何地方都没有看到它提到的内容,但是仍然很挣扎。

Heyy! y! I did nothing (that I know) to fix it, and I am successfully able to switch between different Orgs using different access tokens (previously received using OAuth)! 我没有做任何(据我所知)修复它的工作,并且我能够使用不同的访问令牌(以前是使用OAuth接收到的)成功地在不同的组织之间切换!

R elief ! 相信!

PS: I did try to use cURL (assuming that maybe DBDC was storing the old token and reusing), but all of a sudden when I tried after having success with cURL, it worked with DBDC as well. PS:我确实尝试使用cURL(假设DBDC可能存储了旧令牌并重用),但是当我在成功使用cURL之后尝试使用cURL时,突然之间,它也与DBDC一起使用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM