문제

The Asana API conveniently allows to return results in the form of JSONP, rather than JSON, in order to circumvent the same origin policy for in-browser scripts. However, the documentation says that JSONP is only allowed when authenticated using Asana Connect. That's all well and good, but to use this authentication method, one must attach the obtained "access token" with every request, by adding the following HTTP header,

"Authorization: Bearer ${access_token}"

yet it is not possible to attach arbitrary headers to JSONP requests, the way it is possible to do for normal XHR.

The README of the oauth example provided by Asana says of the access token:

This token can then be used to access the API, in this case typically using JSONP.

But how? Is it somehow possible to include the access token in the query string?

도움이 되었습니까?

해결책

You can now attach the authorization header in a URI param called auth_bearer_token. Hope that helps - and please respond if you have further issues with that.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top