Call authenticated webscript via URL and get JSON
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2016 06:45 AM
Hello,
what is the best way for calling Alfresco webscript (with autentication) via URL request from external Java application?
I need to send authenticated (username and password) request to Alfresco via URL and fetch JSON back to Java application.
Is there some code example to check?
Thank you.
Br, Vojtech
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2016 10:09 AM
Hi Molin,
You can use token mechanism of alfresco.
First get alfresco token using username and password and then use that token to call webscript.
Thanks,
Yogesh Prajapati
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2016 10:29 AM
It is better to use proper names in referring to authentication mechanisms because you will likely not find anything in the documentation about "token mechanism". is referring to Alfresco's authentication ticket feature where you call the /alfresco/s/api/login ReST operation first to authentication using username + password in the JSON POST request which will give you an authentication ticket. This ticket can then be used as a URL parameter called "alf_ticket" in any subsequent web script calls using /alfresco/s/ as the service endpoint to re-use the previously validated login.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-13-2016 11:25 AM
Hello,
thank you both for explanation!
Br, Vojtech
