Sto provando la seguente app di esempio per twitter oauth.android twitter retrieveRequestToken 401 su richiesta token
http://www.androidsdkforum.com/android-sdk-development/3-oauth-twitter.html
private void askOAuth() {
try {
consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY, CONSUMER_SECRET);
provider = new DefaultOAuthProvider("http://twitter.com/oauth/request_token",
"http://twitter.com/oauth/access_token",
"http://twitter.com/oauth/authorize");
String authUrl = provider.retrieveRequestToken(consumer, CALLBACK_URL);
Toast.makeText(this, "Please authorize this app!", Toast.LENGTH_LONG).show();
this.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(authUrl)));
} catch (Exception e) {
Log.e(APP, e.getMessage());
Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
}
}
Quando ho eseguito il seguente codice dà eccezione come segue
"oauth.signpost.exception.OAuthNotAuthorizedException: Autorizzazione non riuscita (server ha risposto con un 401) Questo può accadere se. la chiave del consumatore non era corretta o le firme non corrispondevano ".
su questa linea String authUrl = provider.retrieveRequestToken(consumer, CALLBACK_URL);
ho fornito la 'chiave' corretta e 'segreto' does Twitter mi fornisce tasto sbagliato e segreto?
plz dimmi cosa mettere in CALLBACK_URL ??? – Shruti
l'URL dell'attività Android che verrà chiamato dopo che Twitter ha restituito la risposta –
l'URL dell'attività Android che verrà richiamato una volta che twitter ha restituito la risposta –