jQuery authentication issue


#1

I’ll try to make it as clean as I can, so maybe it will be helpful for someone in future. If there is already thread that could help me, please link it because can’t find it.

  1. I have registered new app at Asana profile and I get from there CLIENT ID & CLIENT SECRET

  2. I have registered/allowed new app at AUTHORIZATION ENDPOINT, but I have no idea where I should put this key in my app (is it username or password?)

  3. At my app based on ajax/jquery I use:

     $.ajax({
     	type : "PUT",
     	url : "https://app.asana.com/api/1.0/tasks/464883008651853",
    
     username: 'CLIENT ID',
     password: 'CLIENT SECRET',
     
    
     data: {"completed":true},
     		success    : function(){
     			console.log("test");
     		}
     	});
    

As an response I get 401 at dev console - authorization failed.

Could someone make it clear for me and maybe more people in future how to integrate && autehnticate APP corectly?


#2

The following discussion might help https://community.asana.com/t/chrome-extension-api-access/10377/8
Make sure to come back and post the solution here :slight_smile:


#3

Not really, I wish some Asana DEV could help.