문제

I'm trying to use a parse.com cloud function in a mailgun route action (forward).

My action is like this (with my app id and JS key included of course):

forward("https://myAppId:javascript-key:myJSkey@api.parse.com/1/functions/hello")

In the mailgun logs, I see it call, but I get the following error:

HTTP Error 401: Unauthorized Server response: 401 HTTP Error 401: Unauthorized

My function is just a simple response.send("OK");

Obviously I'm missing something.

Greg

도움이 되었습니까?

해결책

The issue I think is that the Cloud Code calling convention requires you use special Parse headers, not just keys: it may be different if its being called from a browser with sets the referer headers. I'm not sure you'll be able to call it this way directly from Mailgun: you may need a proxy of some sort.

EDIT: I think you'll need to use the Express Webhook implementation instead, and then you can use standard basic authentication. Cloud Code is really for cases where you have control over the HTTP client you're using.

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