Failed to get auth app token error

I am trying to get the useID ant oAuth from Digits . But when I enter my phone number and click "SEND CONFIRMATION CODE" I got this error:

 E/Twitter﹕ Failed to get app auth token
    com.twitter.sdk.android.core.TwitterApiException: 403 Forbidden
            at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:388)
            at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220)
            at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278)
            at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
            at retrofit.Platform$Android$2$1.run(Platform.java:142)
            at java.lang.Thread.run(Thread.java:818)
E/Digits﹕ HTTP Error: 403 Forbidden, API Error: 99, User Message: Try Again

      

My Application Class Code:

private AuthCallback authCallback;
@Override
public void onCreate()
{
    super.onCreate();

    TwitterAuthConfig authConfig =  new TwitterAuthConfig(BuildConfig.CONSUMER_SECRET, BuildConfig.CONSUMER_KEY);
    Fabric.with(this, new TwitterCore(authConfig), new Digits());
    authCallback = new AuthCallback() {
        @Override
        public void success(DigitsSession session, String phoneNumber) {
            // Do something with the session
        }

        @Override
        public void failure(DigitsException exception) {
            // Do something on failure
        }
    };
}

public AuthCallback getAuthCallback(){
    return authCallback;
}

      

My registration Activity code:

@Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_registration);
        DigitsAuthButton digitsButton = (DigitsAuthButton) findViewById(R.id.auth_button);
        digitsButton.setCallback(((MyApplication) getApplication()).getAuthCallback());

}

      

1. How can I fix this error? 2.What consumer_key

and consumer_secret

I have to use? At https://fabric.io/ I have one consumer_key

u consumer_secret

, but at https://apps.twitter.com I have different consumer_key

u consumer_secret

? I try both, but I get the same error.

+3


source to share





All Articles