简体   繁体   English

如何保存第三者发行的令牌?

[英]How do I save a token issued by a 3rd party?

Scenario: 场景:

I am following the OAuth 2 flow in order to obtain an access token. 我正在遵循OAuth 2流程以获取访问令牌。 Everything works fine using Fiddler. 使用Fiddler一切正常。 I am redirected to the 3rd party login screen, where if I click approve, I see a code appended to the url as a querystring. 我被重定向到第3方登录屏幕,如果单击“批准”,则会看到一个附加在URL上的代码,作为查询字符串。 How do I store this code in my application? 如何将此代码存储在我的应用程序中?

Summary: 摘要:

I get the code from a live website and now I need to use it in my application in order to get the access token using this code. 我从一个实时网站上获取了代码,现在我需要在我的应用程序中使用它,以便使用此代码获取访问令牌。 How? 怎么样?

Thanks in advance. 提前致谢。

SOLVED 解决了

The solution was to give the provider a callback URL which they will call once the user has approved to share their data with our company after logging in via the provider's login interface. 解决方案是为提供商提供一个回调URL,一旦用户通过提供商的登录界面登录后同意与我们公司共享数据,他们便会调用该URL。

I set up a GET in my WEB API controller such that when the provider hits our GET, we get the code and now we can use that to continue the rest of the OAuth flow, eg obtaining an access token. 我在WEB API控制器中设置了GET,以便当提供程序点击GET时,我们就可以获取代码,现在我们可以使用它继续其余的OAuth流,例如,获取访问令牌。

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

相关问题 我的项目引用了另一个引用第三方程序集的项目。 如何设置此第三方组件的装配路径? - My project references another project which references a 3rd party assembly. How do I set the assembly path for this 3rd party assembly? 单元测试时如何删除对第三方代码的依赖? - How do I remove dependencies to 3rd party code when unit testing? 如何避免复制第三方C ++ dll? - How do I avoid copying 3rd party C++ dlls? 如何在第三方XML中创建类型数组的实例? - How do I create an instance of type array in 3rd party XML? 我如何验证第三方用户访问我的Web API asp.net? - how do i authenticate 3rd party user to access my web API asp.net? 如何从Dynamics 365 CRM在线调用第三方REST服务? - How do I call 3rd party REST service from Dynamics 365 CRM online? 如何确定我的后台任务将在生产中调用多少个第 3 方 web api? - How do I determine how many 3rd party web api calls my background task will make in production? 如何在第三方ASP.NET Web API客户端中使用Oauth生成的令牌? - How to use an Oauth Generated Token in a 3rd party asp.net web API client? 如何禁用第三方事件循环 - How to disable 3rd party event loop 如何序列化第三方课程? - How to serialize 3rd party class?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM