Hi, i've been struggling with the basic attempt to log into elgg from my iOS app.. i'm using ionic and angular.
what on earth am i doing wrong? running elgg 2.3.5
I see two calls going out, the first returns:
{"status":-1,"message":"auth.gettoken must be called using 'POST'"}
the second response i get is:
"Response {_body: "{"status":-1,"message":"Missing parameter username in method auth.gettoken"}", status: 200, ok: true, statusText: "OK", headers: Headers, …}"
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- ihayredinov@ihayredinov

ihayredinov - 0 likes
You must log in to post replies.I am not exactly sure how ionic prepares the request, but a) you have a typo in your Content Type header, b) it seems you are sending a url encoded string in POST body. Elgg is not able to access your variables.
1) Either send a POST request with multiplart/form-data content type and put your variables into the form data boundaries,
or 2) Send a POST request, but put your varialbles into the URL's query string, as if you were sending a GET request
Elgg uses Symfony's HTTP foundation, so you may find some more info their docs on how to build a proper HTTP request that is understood by Elgg.