So I am creating a simple web application using the MEAN stack. I am trying to connect to asana through asana connect using the browser pop-up example. For a simple test I have code that is nearly identical to the example, but I still get the error shown as the title for this question.
I'm not sure what might be going wrong but here is the code.
The authentication is supposed to happen after a button click. The client id, client secret are taken from my account settings on the main website. The redirect uri is also set to http://localhost:3000, so I know for sure that they match.
$scope.signIn = function(){
var client = Asana.Client.create({
clientId: My client id,
clientSecret: my client secret,
redirectUri: 'http://localhost:3000'
});
client.useOauth(
{
flowType: Asana.auth.PopupFlow
});
client.authorize().then(function(){
console.log("log-in success");
}).catch(function(err){
console.log(err);
});
};