Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAuth callback URL must be a string #70

Open
ohalligan opened this issue Apr 4, 2017 · 5 comments
Open

OAuth callback URL must be a string #70

ohalligan opened this issue Apr 4, 2017 · 5 comments

Comments

@ohalligan
Copy link

Hello there,
I've been developing an application using Electron but I have a problem authenticating users. Most of the times, when I call the getRequestToken function and redirect the user to the login form, evernote throws an error:

Uncaught AssertionError: path must be a string

This is my code is structured:

var Evernote = require('evernote');
var client = new Evernote.Client({
  consumerKey: 'consumer',
  consumerSecret: 'secret',
  sandbox: false
});

client.getRequestToken("http://localhost:53546/", function(error, oauthToken, oauthTokenSecret) {
    if (error) {
    // do your error handling here
    }
    oauthStore.oauthToken = oauthToken;
    oauthStore.oauthTokenSecret = oauthTokenSecret;
    mainWindow.loadURL(client.getAuthorizeUrl(oauthToken)); // send the user to Evernote
});

The problem is that 95% of the times, the callback is not called. I even tried it with a different URL (not localhost), but the issue remains.

Thank you.

@akhaku
Copy link
Contributor

akhaku commented Apr 9, 2017

To be clear - you're saying it errors out before the callback is called, so in the getRequestToken method? Do you have a stack trace?

@pahund
Copy link

pahund commented May 1, 2017

I have the same problem, also trying to authenticate with an Electron app.

See my relevant code on GitHub:

https://github.com/pahund/fit17/blob/evernote/src/mainProcess/evernote/index.js

The Evernote login window appears, I enter my credentials, hit submit.

The user name and password are correct (registered on the Evernote sandbox).

The screen goes blank, Electron's developer console shows this error:

"AssertionError: path must be a string
    at Module.require (module.js:497:3)
    at require (internal/module.js:20:19)
    at https://sandbox.evernote.com/ro/Lzk2MWRlZmU5MzJhMDg4NzdkN2M4NmVlZTVjNDFlOTIyZDMyMDg3YzAuanM/L2RhMDJmMDE1MWU5NDc2NzFjMTg5MDcwMzY5ODkyNjI4NWU1YTk5MDcuanM/1659902046.js:81:71"

The error message leads me to believe that the error occurs in the JS code of the Evernote sandbox, not in my code.

My OAuth callback URL is not called from the Evernote sandbox, the log statements I've put there are not executed.

@isNeilLin
Copy link

@ohalligan @pahund I have the same problem. Did you fix it ?

@isNeilLin
Copy link

@akhaku Here is stack trace
image

@pahund
Copy link

pahund commented Sep 18, 2018

No, I hadn't found a fix or workaround, sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants