How to send POST requests using SSL using ember data?

I would like to create a user in my ember app and send information to the server using SSL. I'm not sure how to do this. Can I set my model url to address https

? From what I read about SSL, it is against the same Javascript origin policy for using SSL with ajax function.

I may have missed something simple, but I couldn't find it in the documentation or other questions here.

+3


source to share


1 answer


Maybe I am missing something simple

This will be very easy if you just serve everything over SSL. Ember will use the request protocol and domain to generate the API url for your models, so if the page itself is being requested over SSL, your API requests will also.



Is it practical?

Yes. Since you want to create users, I will assume that you authenticate them as well. Any application (ember / rails / php / whatever) creating / authenticating users should only use SSL. If instead you just use SSL to login and then pass an unencrypted session cookie, that cookie could be stolen using a man-in-the-middle attack. See this answer: fooobar.com/questions/131622 / ...

+1


source







All Articles