Search code examples
asanaasana-connect

The `redirect_uri` parameter does not match a valid url for the application


So this is really weird: But When trying to connect with Asana I get: Error: invalid_request: The `redirect_uri` parameter does not match a valid url for the application.

I have literally copied and pasted the example from here

See all set up

I've literally done everything I can do (Ive been researching all day but nothing works - about 6 hours) What Am I doing wrong?


Solution

  • You can use the variant of the special redirect URI, urn:ietf:wg:oauth:2.0:oob:auto (same as the other, just :auto appended to the end) which is intended for apps that drive a browser themselves and can programmatically read out the token and close the window.

    But for both of the redirect URIs you are using, the title of the window should read Success <query-string> where that string is the query parameters that would get passed to the redirect. So for the authorization flow it will include code=....

    Your app, assuming it controls a browser window, should be able to navigate to the URL, wait for it to load, read out the title, then close the window, all without user intervention (except for the user actually doing the authorization in the browser window, of course).