本文介绍了从LinqToTwitter IAuthorizer提取BearerToken的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
希望我的回答很简单.
一旦我通过身份验证,是否可以从IAuthorizer中提取BearerToken?使用LinqToTwitter进行授权后,我想进行自己的API调用,并且需要BearerToken进行授权.
Is it possible to Extract the BearerToken from the IAuthorizer once I am authenticated? After using LinqToTwitter to authorize, I want to make my own API calls and I need the BearerToken to do so.
谢谢您的时间!
推荐答案
我假设您正在谈论ApplicationOnlyAuthorizer
.演示分配给IAuthorizer
,因此您需要转换为ApplicationOnlyAuthorizer
来公开BearerToken
,如下所示:
I'm assuming you're talking about ApplicationOnlyAuthorizer
. The demos assign to IAuthorizer
, so you need to convert to ApplicationOnlyAuthorizer
to expose the BearerToken
, like this:
await auth.AuthorizeAsync();
string bearerToken = (auth as ApplicationOnlyAuthorizer).BearerToken;
这篇关于从LinqToTwitter IAuthorizer提取BearerToken的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!