Socialauth-机器人获得的OAuth令牌,然后使用账号信息设备 [英] Socialauth-android get oAuth-token and use account information on device

查看:113
本文介绍了Socialauth-机器人获得的OAuth令牌,然后使用账号信息设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在用的socialauth-的Andr​​oid库登录用户通过Facebook,Twitter和LinkedIn。

到目前为止,我无法找到一个办法让OAuth的令牌回来。有没有一种方法来访问它没有重新实现库中的部分?

此外,当我想使用socialauth签名(见下文code)我在用户名和密码手动虽然我已经设置了该设备的所有账户类型。你能告诉socialauth使用此帐户吗?

  buttonFacebook.setOnClickListener(新OnClickListener(){
        @覆盖
        公共无效的onClick(视图v){
            mSocialAdapter.authorize(ActivityLogin.this,Provider.FACEBOOK);
        }
    });
 

解决方案

我发现的方式来获得令牌

 字符串标记= mSocialAdapter.getCurrentProvider()getAccessGrant()getKey()。
 

I am using the socialauth-android library to log users in with Facebook, Twitter and LinkedIn.

So far I couldn't find a way to get the oAuth-token back. Is there a way to access it without reimplementing parts of the library?

Also, when I want to sign in using socialauth (see code below) I have to type in the username and the password manually although I have all accounts already set up with the device. Can you tell socialauth to use this accounts?

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

解决方案

I found out the way to get the token is

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

这篇关于Socialauth-机器人获得的OAuth令牌,然后使用账号信息设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆