小编Fah*_*had的帖子

如何登录linkedin将访问令牌发送到服务器端

我正在使用这些链接link1,link2通过链接在我的Android应用程序中登录.我还在linkedin开发人员上创建了我的应用程序,还提供了oauth 2.0和javascript的链接.通过在link2中运行代码:

 final Activity thisActivity = this;

    findViewById(R.id.btnLiSignIn).setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            LISessionManager.getInstance(getApplicationContext()).init(thisActivity, buildScope(), new AuthListener() {
                @Override
                public void onAuthSuccess() {
                    // Authentication was successful.  You can now do
                    // other calls with the SDK.
                    Log.d(TAG, "success" + LISessionManager.getInstance(getApplicationContext()).getSession().getAccessToken().toString());
                    Toast.makeText(getApplicationContext(), "success" + LISessionManager.getInstance(getApplicationContext()).getSession().getAccessToken().toString(), Toast.LENGTH_LONG).show();
                }

                @Override
                public void onAuthError(LIAuthError error) {
                    // Handle authentication errors
                    Log.d(TAG, "failed " + error.toString());
                    Toast.makeText(getApplicationContext(), "failed " + error.toString(), Toast.LENGTH_LONG).show();
                }
            }, true);
        }
    }); …
Run Code Online (Sandbox Code Playgroud)

android login linkedin oauth-2.0 linkedin-api

1
推荐指数
1
解决办法
922
查看次数

标签 统计

android ×1

linkedin ×1

linkedin-api ×1

login ×1

oauth-2.0 ×1