Jump to content

c# - How to re-authenticate revoked ever-note application in ever-note API?

Recommended Posts

I recently started using ever-note c# API (evernote-cloud-sdk-windows) to get my notes saved into my oracle database.

I have a valid production activated secret key and value.

I logged in using them form my system and I revoked it from my web base ever-note account in Applications section.

Now I am not able to login from only my system and able is login from other systems. Basically on first login it will ask for permission by showing a popup. But in my system it is not showing it and throwing the following error.

Evernote.EDAM.Error.EDAMUserException: 'Exception of type 'Evernote.EDAM.Error.EDAMUserException' was thrown.'
    Error code: AUTH_ERROR

Code being use:

 // Be sure to put your own consumer key and consumer secret here.
    ENSession.SetSharedSessionConsumerKey("key", "value");
    if (ENSession.SharedSession.IsAuthenticated == false)
    List<ENNotebook> myNotebookList = ENSession.SharedSession.ListNotebooks();

Here ENSession.SharedSession.IsAuthenticated is true but will throw error as mentioned above when I try to fetch notebooks.

I don't see any function in library that can be used to re-authenticate.

If there is any way to re-authenticate?

Below URL says there is a way to do it. But it doesn't help in any way because they didn't mention how to do it.


Link to comment
  • 11 months later...

I was getting this error, too.

So, I changed it to get the oAuth token and pass that to ENSession using SetSharedSessionDeveloperToken, as follows:

var oAuth = new EvernoteOAuthNet.EvernoteOAuth(EvernoteOAuthNet.EvernoteOAuth.HostService.Production, "Key", "Secret", true);
var errorResponse = oAuth.Authorize();
if (!errorResponse.IsNullOrEmpty())
    ENSession.SetSharedSessionDeveloperToken(oAuth.Token, oAuth.NoteStoreUrl);

That seems to work for me.

  • Thanks 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...