loginAs={currentUser} not working ?

Confluence User - 19 Oct, 2024


1. Objective: I am trying to use Joget's JSON API to fetch data from a datalist in a custom HTML script via AJAX for every logged in user.

2. Documentation Reference: In the Joget documentation [JSON API Authentication#MasterLoginUsernameandPassword], it states that using master credentials along with the `loginAs` variable should enable any logged-in user to access the API.

3. Testing the API:
   - I attempted to access the API using different logged-in users, but I encountered an issue.
   - I was unable to access the URL when using any logged-in user other than the admin.

4. Successful Attempt: When I used `loginAs=admin`, I was able to access the data without any issues.

5. Conclusion: It seems that the `loginAs` variable only works correctly with the admin account, as other logged-in users cannot access the API.

6. What i need: I need to access the api using every logged user (i can pass the master crededntials)

database;jsonapi

2


23 Oct, 2024
confluenceUser
confluenceUser

Based on your objective. What kind of list are we referring to ? a list of data without any process attached to it? or with a process attach to it?

if its the former, you may wan to consider using API Builder where you can customize the endpoints of your app. Use the list element List - Marketplace Knowledge Base - Joget | COMMUNITY

if its the latter, to retrieve the list of assignments based on users...you could use :
JSON API - Knowledge Base for DX 8 - Joget | COMMUNITY
or again API Builder
Assignment - Marketplace Knowledge Base - Joget | COMMUNITY


the legacy JSON API , you have to look at the user roles. for example:

web/json/workflow/assignment/list 

where its user role is Anyone (Including anonymous) so then you can use loginAs someone else other than admin.

I recommend using the API Builder. more flexibility and control

25 Oct, 2024
confluenceUser
confluenceUser

Hey,
I have tried but the API Builder plugin is not installing.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print