Failed to get request token on Android M running Devices

com.twitter.sdk.android.core.twitterapiexception: http request failed, status: 403
com.twitter.sdk.android.core.twitterauthexception: authorize failed.
twitter oauth
twitter oauth example
login with twitter android
twitter integration in android
oauth2 firebase
twitter developer login

Twitter login failed in Android 6.0 preview devices. Its working fine on all other devices.

Below code is used to initialize fabric with twitter.

TWITTER_ KEY and TWITTER_SECRET keys were obtained from twitter app settings.

    TwitterAuthConfig authConfig = new TwitterAuthConfig(TWITTER_KEY, TWITTER_SECRET);
    Fabric.with(this, new Twitter(authConfig));

Here is the error log i got during login using TwitterApiClient.

  08-31 07:52:09.988 4692-4692/? E/Twitter: Failed to get request token
  08-31 07:52:09.988 4692-4692/? E/Twitter: com.twitter.sdk.android.core.TwitterApiException: 401 Authorization Required
  08-31 07:52:09.988 4692-4692/? E/Twitter: at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:383)
  08-31 07:52:09.988 4692-4692/? E/Twitter: at retrofit.RestAdapter$RestHandler.access$100(RestAdapter.java:220)
  08-31 07:52:09.988 4692-4692/? E/Twitter: at retrofit.RestAdapter$RestHandler$2.obtainResponse(RestAdapter.java:278)
  08-31 07:52:09.988 4692-4692/? E/Twitter: at retrofit.CallbackRunnable.run(CallbackRunnable.java:42)
  08-31 07:52:09.988 4692-4692/? E/Twitter: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
  08-31 07:52:09.988 4692-4692/? E/Twitter: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
  08-31 07:52:09.988 4692-4692/? E/Twitter: at retrofit.Platform$Android$2$1.run(Platform.java:142)
  08-31 07:52:09.988 4692-4692/? E/Twitter: at java.lang.Thread.run(Thread.java:818)
  08-31 07:52:10.000 4692-4692/? E/Twitter: Authorization completed with an error
  08-31 07:52:10.000 4692-4692/? E/Twitter: com.twitter.sdk.android.core.TwitterAuthException: Failed to get request token
  08-31 07:52:10.000 4692-4692/? E/Twitter: at com.twitter.sdk.android.core.identity.OAuthController$1.failure(OAuthController.java:95)
  08-31 07:52:10.000 4692-4692/? E/Twitter: at com.twitter.sdk.android.core.internal.oauth.OAuth1aService$1.failure(OAuth1aService.java:215)
  08-31 07:52:10.000 4692-4692/? E/Twitter: at com.twitter.sdk.android.core.Callback.failure(Callback.java:45)
  08-31 07:52:10.000 4692-4692/? E/Twitter: at retrofit.CallbackRunnable$2.run(CallbackRunnable.java:53)
  08-31 07:52:10.000 4692-4692/? E/Twitter: at android.os.Handler.handleCallback(Handler.java:739)
  08-31 07:52:10.000 4692-4692/? E/Twitter: at android.os.Handler.dispatchMessage(Handler.java:95)
  08-31 07:52:10.000 4692-4692/? E/Twitter: at android.os.Looper.loop(Looper.java:148)
  08-31 07:52:10.000 4692-4692/? E/Twitter: at android.app.ActivityThread.main(ActivityThread.java:5417)
  08-31 07:52:10.000 4692-4692/? E/Twitter: at java.lang.reflect.Method.invoke(Native Method)
  08-31 07:52:10.000 4692-4692/? E/Twitter: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
  08-31 07:52:10.000 4692-4692/? E/Twitter: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)

Here are the things you need to do

Twitter dev account->setting->callBack url

and then if you are doing for the android (means login using for android devices )

twittersdk:// (add this in callback)

if you are doing for the iOS (means login using for apple devices )

twitterkit-CONSUMERKEY:// (add this in callback)

and hit update settings button it will work :)

Failed to get request token in android · Issue #52 · GoldenOwlAsia , i'm facing the below issue when i click on twitter-login button com.twitter.sdk.​android.core. i'm facing the below issue when i click on twitter-login button com.twitter.sdk.android.core.TwitterAuthException: Failed to get request token can some one help me in this, its bit urgent.

Before this solution, I tried a valid url (even google.com). But, in my case, it did not work.

I then found this solution, which worked well for me:

Step 1: Go to your twitter app's settings by logging in at https://apps.twitter.com/ and selecting the Settings tab, then add twittersdk:// as a callback url. (I found it in lib class.)

Step 2: Save your update.

Step 3: Try your app again.

twitter login error on devcies without twitter app · Issue #18 · twitter , i am using this twitter sdk version 3.1.1 in my unity game , it E/Twitter (12790): /​oauth/request_token E/Twitter (12790): at com.twitter.sdk.android.core.models. On a device without twitter installed, I get a login failure error  Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question.Provide details and share your research! But avoid …. Asking for help, clarification, or responding to other answers.

I have same problem and solved. In my case i need to set callback url in twitter dev account.

Twitter dev account->setting->callBack url(set any valid url like www.google.com)

Authenticate to OAuth2 services, For apps targeting Android 6.0 (API level 23) and higher, To get the token, call AccountManager. Your first request for an auth token might fail for several An error in the device or network caused AccountManager to fail. Getting MainAxgetToken: Prompt is not allowed and failed to get token in Android 7.1 devices #829 Closed ramprasad1477 opened this issue May 3, 2017 · 9 comments

this is the best solution when twitter auth not working without app. i tried with valid firebase auth callback url but not working and i also search this problem a lot but not getting the exact solution, @Moinkhan solution worked for me and save my time, thanks to @Moinkhan, it works

Before this solution i tried valid url and even google.com too. But for my case it was not working.

i found below solution and it work well for me.

Step 1: go to your twitter app setting https://apps.twitter.com/ >> Tab settings >> Fill this text "twittersdk://" to your callback url field( i found it in lib class)

Step 2: Save your update

Step 3: check out your app again

Manually Build a Login Flow, Apps using our SDKs can check whether someone has already logged in https:​//www.facebook.com/ v6.0 /dialog/oauth? client_id={app-id} This will return control flow back to your app with an access token on success, or error on failure. Getting this exception : Failed to get provision request: DRM vendor-defined error: -2990 when any DRM enabled video is tried to play on a Le-Max Le X507 device. I am attaching a LogCat Snippet here. If needed I will send the full bug report.

I was facing the same issue(just moments back). Go to Twitter Application Management -> Click on the 'app' on which you are currently working -> Click on 'Settings' tab -> 1) Callback URL: Insert any valid url(like homepage of your website) 2) Enable Callback Locking (It is recommended to enable callback locking to ensure apps cannot overwrite the callback url): Verify that it is unchecked

Twitter Kit tries to use a webview if the twitter app is not found. The webview part of Twitter kit needs to override the callback url. Info about Callback Url field clearly states: To restrict your application from using callbacks, leave this field blank. So, we need to write down any valid url :)

Reference: Personal experience obtained moments back :P Failed to get request token

Verify ID Tokens, Once you have an ID token, you can send that JWT to your backend and validate it using the Firebase Admin SDK, or  Failed to get the linked token information Greetings, I have run command line that executes a vbscript that is giving the following error: failed to get the linked token information. It may not be available.

AppAuth for Android by openid - OpenID on GitHub, AppAuth for Android is a client SDK for communicating with OAuth 2.0 and out in OAuth 2.0 for Native Apps including using Custom Tabs for the auth request. an error like: Error:Could not find com.android.support:customtabs:23.2.0. then  Now after the user has authenticated you will get an access token instead of an authorization code. You can then proceed to use AVS right away. The link that you attached is written for the use case where you wanted to generate an authorization code on your mobile app, and pass the Login with Amazon OAuth 2.0 authorization code

Cloud API | Reference Documentation, All requests to the device come through our API server using TLS security. and only you will have permission to control your Particle device—using your access token. 500 Server errors - Fail whale. This is also a common symptom if you are in a dual domain. If you run in a dual domain and find the Jabber client is not being returned any User Data Service (UDS), you must ensure your configuration follows the DNS section of the Configuration Note: Mobile and Remote Access through Expressway/VCS in a multi-domain deployment.

Retrieve an Access Token and Refresh Token, As soon as the Device Authorization Request returns a response, you should begin making Device Token Requests to  Which version of the AzCopy was used? 10.0.7 Which platform are you using? Linux (Ubuntu WSL) What command did you run? azcopy login What problem was encountered? "failed to perform login command, failed to get keyring during saving toke

Comments
  • somethimes in developer console r u authenticate wia email is these confirm from your side ?? and check both virtual and real device...!!!
  • Please don't keep posting the same answer in multiple old questions. Flag as duplicate if you think they are.stackoverflow.com/questions/30511345/…
  • The intention was to allow user to get answer even if the user visit this post.
  • @Shree and the question are different but solution are same for current scenario. But in future it can be a different
  • @Moinkhan Thank you
  • Thanks @Moinkhan
  • I have already did it.Igot below error: com.twitter.sdk.android.core.TwitterAuthException: Failed to get request token The reason for this error is i dont have twitter app installed.If i do then it works fine What should i have to do?
  • @Rajat Same Problem here and that to SDK.M Devices only........... please anybody help..........
  • You saved my day. I wonder this is not working without the "twittersdk://"? Are you using Firebase UI?
  • Twitter mustn't be installed on the device, it will open web view instead