dburchik

EDAMUserException(errorCode:8,parameter:"consumerKey")

14 posts in this topic

I use your API for my iPhone app. I took your example from the http://www.evernote.com/about/developer ... te-api.pdf and rewrite it on objective c.

I use the following urls:

	NSURL *userStoreUrl = [[NSURL alloc] initWithString:@"https://www.evernote.com/edam/user"]; 
NSURL *noteStoreUrlBase = [[NSURL alloc] initWithString:@"http://www.evernote.com/edam/note/"];

and consumer key and secret that I received by email.

I try to execute the code:

	EDAMAuthenticationResult *authResult;
@try {
authResult = [userStore authenticate:username :password :consumerKey :consumerSecret];
}
@catch (EDAMUserException *e) {
NSLog(@"%@: %@", [e name], [e description]);
}

but the exception occurs: EDAMUserException(errorCode:8,parameter:"consumerKey").

Thanks.

Share this post


Link to post

That error means that the consumerKey you gave is not valid.

It looks like you are making requests directly to the production web server (www.evernote.com).

If you have a new key, it is probably only on our sandbox server (sandbox.evernote.com).

Change the "www" in your URLs to "sandbox"

When your application is ready, we can promote the key to the production servers, but you should do your initial development and testing against the sandbox server.

Share this post


Link to post

I'm experiencing the same problem. I'm using the consumer key and consumer secret you provided when I registered and am attempting to connect to sandbox.evernote.com. I've tried this with both http and https but both provide the same response.

Thanks.

Bill

Share this post


Link to post

Please double-check that the consumerKey string is correct, and make sure that you're hitting sandbox.evernote.com

If that still fails, then reply to the email you received with the API key and we can investigate further.

Share this post


Link to post

Thanks.

I'm connecting to sandbox, although I did try to test with www to verify that the same thing happens in both cases, and it does. I

I replied to the email you folks sent with the info you requested and await your reply.

Thanks.

Bill

Share this post


Link to post

I'm almost positive that the consumer key and secret I received isn't valid. I can connect using the EDAM test script when I used another valid consumer key/secret one I found.

To test, I did the following:

1. I installed the Evernote Drupal extension,

2. I configured Drupal to use it.

3. Drupal connected to sandbox.evernote.com using the key and secret included.

4. I found the consumer key and secret in the source.

5. I swapped these values for the key and secret Evernote sent to me in my test script.

6. I ran the EDAM test script. For the first time it worked. Yay. But not with my key/secret.

At least I have a work-around that allows me to do my work for the time being.

Thanks again.

Bill

Share this post


Link to post

I'm having exactly the same error from a native MacOS app written in Objective-C ( EDAMUserException(errorCode:8,parameter:"consumerKey") ).

The issue is even worse 'cos I have a web application that uses this key/secret pair and it works. Any hints on what I should be doing wrong?

Share this post


Link to post

We have two types of API keys: client keys and web service keys. Client keys are intended to authenticate using username and password via the UserStore.authenticate function, while web service keys authenticate using OAuth. Your existing web service key won't work with your client application that's (presumably) trying to authenticate using username and password. You can request a new client key from http://www.evernote.com/about/developer/api/.

Share this post


Link to post

Hello Seth,

Where can I get the client key?

The details I'm using are the one sent in "Evernote API Key" email you guys are sending. Using these details I want to use the UserStore.authenticate but it doesn't work at all.

Here is the test code (Nodejs + evernode):


var thrift = require('thrift'),
evernode = require('evernode'),
customConnections = evernode.customConnections,
UserStore = evernode.UserStore;
var user_connection = customConnections.createHTTPSConnection( 'sandbox.evernote.com', 443, '/edam/user' );
var user_client = thrift.createClient( UserStore, user_connection );
user_client.authenticate(
'alexdeefuse'
, 'my password'
, 'alexdeefuse'
, 'secret goes in here'
, function(err, res){
if(err) {
console.log(err);
}else{
console.log(res);
}
}
);

The code above, when running with node returns:


{ name: 'EDAMUserException',
errorCode: 8,
parameter: 'consumerKey' }

I did test it out with AS3 as well:


var r:URLRequest = new URLRequest();
r.url = 'http://sandbox.evernote.com/edam/user';

var client :THttpClient = new THttpClient( r, true );

var protocol :TBinaryProtocol = new TBinaryProtocol( client );

var user_store:UserStore = new UserStore( protocol, protocol );

user_store.authenticate(
'alexdeefuse',
'my password',
'alexdeefuse',
'my secret',
authenticate_successHandler,
authenticate_errorHandler
);

The AS3 version returns:

EDAMUserException(errorCode:INVALID_AUTH (8), parameter:consumerKey)

Regards,

Alex

1 person likes this

Share this post


Link to post

@alexdeefuse Client authentication (using the user's username and password) has been deactivated a couple of weeks ago. You must now use OAuth to authenticate a user.

Share this post


Link to post

@Julien Got it. Thanks!

Is it possible to customize the "Authorization" page? I would like to "embed" that inside a mobile application written in AS3. What do you think?

Share this post


Link to post

The authorization page cannot be customized since it's hosted on our service.

Share this post


Link to post

@Julien Hey,

I got everything working using OAuth. Thanks for that.

The tech stack that I'm using is AS3 with Adobe Air and the final result will run on ios devices.

The current method I'm using, involves using the StageWebView and I load the login page in that.

This method as you can guess has a lot of disadvantages (like speed, initial wait time while the page loads, the lack of customization etc.) and I would like to use some libraries (like Starling and FeathersUI) to get the app move much faster and more naturally.

What I would like to do is something similar to the "Hello" app.

While looking at "Hello", I connected the iphone to the computer and looked at the requests it does.

The request I'm interested in is the one to "https://www.evernote.com/edam/user".

This request sends the following details via thrift:

authenticate myusername mypassword en-ios-hello f#########b

Is there a way to do this with the current authentication? From what I can make of it... the apps you guys publish are somewhat special in terms of consumer key and "user authorization" and that screen doesn't get displayed.

I did try to add to my code ( it uses UserStore.authenticate ) the "en-ios-hello" client key and the "f#########b" secret and everything works... So this works with some older apps but not with the new ones.

Regards,

Alex

Share this post


Link to post

If you are interested in the User object, you can call UserStore.getUser using an OAuth authentication. You won't get the user's email though since it's not available with that type of key.

Share this post


Link to post