[英]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.