Hi everyone,
I’m trying to add an app I created that makes use of components to a project, so I need to set up OAuth in order to authorize the app.
The thing is, I implemented the whole OAuth flow and it seems to work correctly on my server, but on Asana it keeps waiting for authorization and never connects.
I set up the custom authentication URL and, as I said, everything seems to be fine. I also can get the token correctly using the code that I receive on the authentication endpoint.
Following the docs, I’m returning an HTML in response to the authorization request including the following script:
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>You have successfully connected Asana to the app</title>
</head>
<body>
Success!
<script>
window.opener.postMessage("success", "https://app.asana.com");
window.close();
</script>
</body>
</html>
in order to respond with “success” on the same window that the authorization request opens.
However, as you can see on the image above, the app doesn’t connect with Asana.
Inspecting the network flow I noticed that it seems Asana is reporting an exception after I return the HTML. On the console appears the following:
POST https://app.asana.com/app/asana/-/report_client_exception?session...
Any idea about why can’t I connect the app to Asana? Maybe I’m overlooking something?
Thanks in advance!