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