What's the better way to call a service exposed on WebServiceAPI (with authentication) from client in the elgg site with javascript?
How to retrieve the auth_token from a logged in user?
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.
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- Gustavo Caldeira@gucaldeira
Gustavo Caldeira - 0 likes
- Juho Jaakkola@juho.jaakkola
Juho Jaakkola - 0 likes
- Nikolai Shcherbin@rivervanrain
Nikolai Shcherbin - 0 likes
- Gustavo Caldeira@gucaldeira
Gustavo Caldeira - 0 likes
- Gustavo Caldeira@gucaldeira
Gustavo Caldeira - 0 likes
You must log in to post replies.Start with it [Elgg 1.8]:
Learn more
Ok, but the method auth.gettoken requires the username and password... I want to call a service with the logged user.. without store the username and password.
I implemented a solution generating a token manually with the following code to use in future requests .. I do not know if it's the best way to do this but it worked..
/views/default/js/api_token.php
This doesn't seem right. Why are you using web services for a user that is already logged into Elgg? The whole point of web services is to allow integration with other software.
@Gustavo Caldeira What's your goal?
I'm creating an Angular page... and calling services from that..
https://community.elgg.org/discussion/view/2167945/why-not-allow-js-applications-calls-webservice-methods