我使用 Scribe 连接到 LinkedIn。但是在尝试连接时出现此错误:
org.scribe.exceptions.OAuthException: Response body is incorrect. Can't extract token and secret from this: 'oauth_problem=Scope%20NOT_AUTHORIZED%20%3A%20r_fullprofile'
我使用此代码获取 RequestToken
authService = new ServiceBuilder().provider(LinkedInApi.class).apiKey(LINKEDIN_APP_ID).apiSecret(LINKEDIN_APP_SECRET).callback
(LINKEDIN_CALLBACK).build();
new RequestTokenTask().execute();
//some code
class RequestTokenTask extends AsyncTask<Void, Void, Void> {
@Override
protected Void doInBackground(Void... params) {
try {
requestToken = authService.getRequestToken(); //error here
authURL = authService.getAuthorizationUrl(requestToken);
} catch (Exception ex) {
ex.printStackTrace();
}
return null;
}
@Override
protected void onPreExecute() {
progressBar.setVisibility(View.VISIBLE);
}
@Override
protected void onPostExecute(Void result) {
progressBar.setVisibility(View.GONE);
webView.loadUrl(authService.getAuthorizationUrl(requestToken));
}
}
我该如何解决这个问题?
更新:我在设置“r_fullprofile”权限时看不到。我做错了什么?