There is a problem with authorization via twitter in android application imported into Fabric project connected as it is written in the docks, and hung their callbacks to get a token for use on the server. And like all good, even once it worked, but given the same token that has expired, and to them I can no longer use. I tried to remove the app, it is useless all exactly the same outdated token gives me. Here is the code that I’m trying to get the token:
Twitter.getSessionManager().clearActiveSession();
TwitterCore.getInstance().logIn(this, new com.twitter.sdk.android.core.Callback<TwitterSession>() {
@Override
public void success(Result<TwitterSession> twitterSessionResult) {
String token = twitterSessionResult.data.getAuthToken().token;
if (token != null) {
authService(token, "twitter");
} else {
Toast.makeText(LoginActivity.this,
"Не удалось установить соеденения с Twitter", Toast.LENGTH_LONG).show();
}
}
@Override
public void failure(TwitterException e) {
Toast.makeText(LoginActivity.this,
"Не удалось установить соеденения с Twitter", Toast.LENGTH_LONG).show();
}
});
For information on the token I get using:
https://api.twitter.com/oauth/authorize?oauth_token=token
How can I fix it to always return a new token?