Jump to content

Welcome! You're currently a Guest.

If you'd like to join in the Discussion, or access additional features in our forums, please sign in with your Evernote Account here. Have an Evernote Account but forgot your password? Reset it! Don't have an account yet? Create One! You'll need to set your Display Name before your first post.

Photo

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


  • Please log in to reply
13 replies to this topic

#1 dburchik

dburchik

  • Pip
  • Title: Member
  • Group: Members
  • 1 posts

Posted 29 September 2010 - 11:22 AM

I use your API for my iPhone app. I took your example from the http://www.evernote.... ... 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.

#2 engberg

engberg

  • Title: Evernote Employee
  • Group: Evernote Employee
  • 12,536 posts

Posted 30 September 2010 - 12:04 AM

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.

- Dave Engberg (Evernote)


#3 wjf42

wjf42

  • Pip
  • Title: Member
  • Group: Members
  • 6 posts

Posted 05 October 2010 - 06:09 PM

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

#4 engberg

engberg

  • Title: Evernote Employee
  • Group: Evernote Employee
  • 12,536 posts

Posted 05 October 2010 - 06:38 PM

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.

- Dave Engberg (Evernote)


#5 wjf42

wjf42

  • Pip
  • Title: Member
  • Group: Members
  • 6 posts

Posted 05 October 2010 - 07:45 PM

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

#6 wjf42

wjf42

  • Pip
  • Title: Member
  • Group: Members
  • 6 posts

Posted 06 October 2010 - 04:48 PM

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

#7 mauriciolinhares

mauriciolinhares

  • Pip
  • Title: Member
  • Group: Members
  • 12 posts

Posted 07 December 2010 - 02:41 AM

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?

#8 SethH

SethH

  • Title: Evernote Employee
  • Group: Evernote Employee
  • 684 posts

Posted 08 December 2010 - 12:03 AM

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..../developer/api/.

#9 alexdeefuse

alexdeefuse

  • Pip
  • Title: Member
  • Group: Members
  • 3 posts

Posted 10 December 2012 - 03:13 PM

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

#10 Julien Boedec

Julien Boedec

  • Title: Browncoat
  • Group: Evernote Employee
  • 408 posts

Posted 10 December 2012 - 09:13 PM

@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.

#11 alexdeefuse

alexdeefuse

  • Pip
  • Title: Member
  • Group: Members
  • 3 posts

Posted 11 December 2012 - 10:38 AM

@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?

#12 Julien Boedec

Julien Boedec

  • Title: Browncoat
  • Group: Evernote Employee
  • 408 posts

Posted 11 December 2012 - 10:32 PM

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

#13 alexdeefuse

alexdeefuse

  • Pip
  • Title: Member
  • Group: Members
  • 3 posts

Posted 12 December 2012 - 02:42 AM

@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

#14 Julien Boedec

Julien Boedec

  • Title: Browncoat
  • Group: Evernote Employee
  • 408 posts

Posted 12 December 2012 - 06:54 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Clip to Evernote