I am getting an error in the process of OAuth in evernote SDK sample HelloEDAM.
org.scribe.exceptions.OAuthException: Response body is incorrect. Can't extract token and secret from this
Is there any way to get rid off this problem?
The exception should include the actual response body:
throw new OAuthException("Response body is incorrect. Can't extract token and secret from this: '" + response + "'", null);
Can you add that so we can see what you're getting back?
Maybe a bit late... but I'll answer for future visitants.
Probably you didn't change the EVERNOTE_CONSUMER_KEY and the EVERNOTE_CONSUMER_SECRET by default.
You must to ask for an API key at the Evernote for Developers webpage:
https://dev.evernote.com/
You should add that in your gradle.properties, and follow the instructions at
https://github.com/evernote/evernote-sdk-android
Disclaimer: At least, I'm getting the same exception today with the latest Evernote SDK, I don't know how it was three years ago.
Related
I want to test the Twitter api for an app in the future. I was trying to test it with Postman but I get this error all the time.
"code": 32,
"message": "Could not authenticate you."
I made an new app from my developers account and put all the generated tokens into postman like this:
My parameters are the same like this screenshot: (with the correct tokens)
Do I need to check something important?
I hope someone has already faced this problem or just can help me with this.
Under the "Authorization" tab in Postman, choose "Request Headers" from the "Add authorization data to:" drop down.
Useful reference:
https://developer.twitter.com/en/docs/basics/authentication/guides/authorizing-a-request.html
Error 32 "Could not authenticate you" can also happen when the content of the tweet triggers the Twitter censorship filter.
For anyone still having issues...
My problem was that the Content-Type: application/x-www-form-urlencoded header was not set for my POST request when testing with Postman. Once I added that, all was well.
Another thing to check is the ! character in the status that's being posted. Ensure it's encoded correctly.
See here for more details: https://groups.google.com/d/msg/google-appengine/6ILDt39anbs/gEwMVBNJLkYJ
Follow the picture and you will get the correct return.
I'm trying to implement the sample Twitter Digit app available on Github.
https://github.com/twitter/digits-android
But after following all the steps and populating every known place with API key and API secret.
My code is same I've just populated the properties file.
I'm getting: Digitsīš HTTP Error: 403 Forbidden, API Error: 239, User Message: Try Again
Can anyone tell where the mistake is ?
The project will not work when copied as-is. You need to replace the consumer key and secret provided in the example project with your own. You can generate your own consumer key and secret via Fabric web portal.
#stack5: I have written this answer after reading the comments. I found that you've already received your answer. I'm writing this here so that anybody else facing similar issue would get benefited. Please accept this answer for the community.
When i try submit scores from Android Unity game i receive next error:
You are trying to load data from a www stream which had the following error when downloading.
ava.io.FileNotFoundException: https://graph.facebook.com/me/scores
FB.Login("publish_actions", OnLoginComplete);
var query = new Dictionary<string, string>();
query["score"] = "110";
FB.API("/me/scores", Facebook.HttpMethod.POST, delegate(FBResult r) { Debug.Log("!!!! Score submit result: " + r.Text); }, query);
Facebook sdk version 5.1.0
Unity version 4.5.2f1
For posterity, the most common cause of this error is not having your app configured as a "Game" in the app settings on Facebook. OP and I talked elsewhere, earlier, and ruled that out in this case, but for anyone else finding this post via search, make sure you check that.
To clarify, the code starting with "var query" - is it possible that it is running before OnLoginComplete is called? If you've ruled that out, could you verify whether the problem might be with the grant of permissions? An easy way to do that would be to log the value of the access token right when you make the call to FB.API, then copy-paste that into the access token debugging tool at https://developers.facebook.com/tools/debug and verify that it actually has publish_actions. You could also just take that token and use it in curl in verbose mode (curl -kv "https://graph.facebook.com/me/scores?score=110&access_token=TOKEN"), and see if the headers or response body gives any additional clues.
I am working on an application in which I had to make a new project from existing code. The parent project contains Twitter support classes and Twitter is working fine in that application. But in the newly created project, the Twitter throws following error:
oauth.signpost.exception.OAuthNotAuthorizedException: Authorization failed (server replied
with a 401). This can happen if the consumer key was not correct or the signatures did not
match.
This is quite strange for me. Twitter does not work. However if i run the old snippet it works...Why not on the new one? when there is no difference between the Twitter implementation in the both projects. I have verified date/time on the devices..but that is not issue. Any help please..???
With what you have posted it is nearly impossible to help you. i can just provide some help:
First check the keys (secret and id) you got from twitter.
Check your permissions (probably have this right since it is a response from twitter)
Then check if your Auth process is going ok. that is if the Request is signed right,
then check the auth callback, if it was processed correctly (how does your implementation return the oauth token?).
I'm trying to make an app that accesses a user's Google Calendar using OAuth. I have the code in place that gets all of the proper tokens and they are saved into some preferences. I used the tutorial here to do this all, by the way. I have successfully changed the scope and request URL's so that I'm getting the needed tokens. The problem comes when I actually try to USE the token. Instead of calendar info, I get back some HTML that says "Unknown authorization header Error 401". The request URL I am using is:
https://www.google.com/calendar/feeds/default/allcalendars/full
and the scope is:
http://www.google.com/calendar/feeds/
I have tried replacing 'default' with my email address (which is also the one that I used for the OAuth) to no avail. Am I using the wrong URL? if not, what else could cause this error? I have been looking for a few days now to find someone who has accessed the Calendar using OAuth, but everything I have found is people giving up because it's too difficult or doesn't work.
EDIT:
I believe my header is correct, here is an example of it:
OAuth oauth_token="************-********-**********-****",
oauth_consumer_key="anonymous",
oauth_version="1.0",
oauth_signature_method="HMAC-SHA1",
oauth_timestamp="1303161387",
oauth_nonce="*******************",
oauth_signature="*******************"
That is pulled directly from my app, and from what I could find it looks right to me, but I'm still getting the error above (Unknown Authorization Header Error 401).
The Authorization header needs to be "Authorization: OAuth oauth_nonce="deadbeefdeadbeef" oauth_version="1.0" ....
See http://code.google.com/apis/accounts/docs/OAuth_ref.html#RequestToken. You can, supposedly, also but the authorization parameters in the querystring or in the body of a POST, but I have not attempted that.
As noted in the comments below, Google is now, at least with the Calendar feed, appending a 'gsessionid=' querystring and redirecting; and so a redirect handler must create a new nonce and timestamp, and make a new signature making sure to add the gsessionid to the base signature string in the correct lexicographical order (preceding any of the oauth_ variables).