android - Socialauth-android 获取oAuth-token并使用设备上的账户信息

标签 android oauth socialauth

我正在使用 socialauth-android 库让用户登录 Facebook、Twitter 和 LinkedIn。

到目前为止,我找不到取回 oAuth token 的方法。有没有一种方法可以在不重新实现库的某些部分的情况下访问它?

另外,当我想使用 socialauth 登录时(见下面的代码),我必须手动输入用户名和密码,尽管我已经为设备设置了所有帐户。你能告诉 socialauth 使用这个帐户吗?

buttonFacebook.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            mSocialAdapter.authorize(ActivityLogin.this, Provider.FACEBOOK);
        }
    });

最佳答案

我发现获取token的方法是

String token = mSocialAdapter.getCurrentProvider().getAccessGrant().getKey();

关于android - Socialauth-android 获取oAuth-token并使用设备上的账户信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14370817/

相关文章:

python - oAuth "Password was not given but private key is encrypted"

python - OAuth登录完成后重定向到之前的URL(flask-dance)

oauth - 如何在 postman 收藏中保留OAuth2 token (或使用刷新 token )?

android - 空 Activity 的 setContentView 上的 StrictMode 磁盘读取冲突

android - phonegap google play 和邮件链接

android - 通过将 Imageview 左上角视为 (0,0) 来获取 Imageview 的 X,Y 坐标

android - 如何解决 Socialauth-Android for twitter?

android - socialauth-android 与 Facebook 授权成功但验证码为空

Android在第一次初始化应用程序时选择安装存储