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

The Asana.auth.PopupFlow does not work #256

Open
miso-belica opened this issue Mar 28, 2022 · 1 comment
Open

The Asana.auth.PopupFlow does not work #256

miso-belica opened this issue Mar 28, 2022 · 1 comment

Comments

@miso-belica
Copy link

Hello there :)

I have an issues with the OAuth authentication method in the browser. I would like to authenticate different users in the browser to use Asana API. I need to do this because I would like to create tasks in Asana and have the users as the authors of the tasks. I use the code from

var client = Asana.Client.create({
clientId: CLIENT_ID,
// By default, the redirect URI is the current URL, so for this example
// we don't actually have to pass it. We do anyway to show that you can.
redirectUri: REDIRECT_URI
});
// Configure the way we want to use Oauth. This auto-detects that we're
// in a browser and so defaults to the redirect flow, which we want.
client.useOauth();
// Now call `authorize` to get authorization. If the Oauth token
// is already in the URL, it will pull it out and proceed. Otherwise it
// will redirect to Asana.
client.authorize().then(function() {
// The client is authorized! Make a simple request.
$('#ui').html('Fetching...');
return client.users.me().then(function(me) {
$('#ui').text('Hello ' + me.name);
});
}).catch(function(err) {
$('#ui').html('Error: ' + err);
});
but unfortunatelly when the new popup window opens there is an error unsupported_response_type: The supported response types are code, id_token, code id_token, and dentity.. The problem is with the response_type=tokenquery parameter in the URL caused by the line at
'response_type': 'token',
I found an issue #144 here with some answer but requesting the user to authenticate every hour is not an option for the app I am developing. I wanted to ask if there is really no other way to get this working? I imagine it the same way as FB/Google/... flow works when I authenticate once and it persists for weeks and don't annoy the user every hour/day.

And if there is no workaround or fix for this I would maybe suggest to delete the obsolete examples and the code so people are not confused why it doesn't work.

Thanks in advance for the help and have a nice day 🙂

\cc @matthias-fi

@cmerther
Copy link

Hello, did you ever find a solution for the popup flow? Still seems to be broken in the lib.

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

No branches or pull requests

2 participants