Extract BearerToken from LinqToTwitter IAuthorizer

让人想犯罪 __ 提交于 2019-12-02 03:56:23

问题


Hopefully a simple answer to what I think is a simple question.

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.

Thank you for your time in advance!


回答1:


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;


来源:https://stackoverflow.com/questions/45928634/extract-bearertoken-from-linqtotwitter-iauthorizer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!