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

Problems doing OAuth2 with HarvestApp. #31

Open
jcfergus opened this issue Oct 20, 2017 · 0 comments
Open

Problems doing OAuth2 with HarvestApp. #31

jcfergus opened this issue Oct 20, 2017 · 0 comments

Comments

@jcfergus
Copy link

jcfergus commented Oct 20, 2017

Ok, I've been banging on this most of a day and am not sure how this is supposed to be working. I'm implementing an ember-cli app, and trying to use ember-oauth2 and ember-token-auth to authenticate against Harvest (https://help.getharvest.com/api-v2/authentication-api/authentication/authentication/). (Implicit (client-app) auth flow.) .

I have things working to the point of openWIndow getting called and opening the authentication window, but what seems to be happening is that parseCallback is being called immediately after the dialog is opened, and is getting passed the dialog window and not the locationHash string.

So:

openWindow(url)

returns a promise that is resolved with:

resolve(dialog);

which then is returned from authorize() in ember-oauth2.js:

authorize() {
    return this.openWindow(this.authUri());
}

which is then handled in authorize() in login.js:

sessionCurrent.get('auth').trigger('redirect', response);

That response (the dialog window) is then passed directly into parseCallback() in the handleRedirect function in ember-oauth2.js:

 handleRedirect: Ember.on('redirect', function(hash, callback) {
    let self = this;
    let params = self.parseCallback(hash);

This doesn't seem to be how things are /supposed/ to be working, but I'm not sure if it's something specific to Harvest, or something more general. Halp?

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

1 participant