Calling DHIS2 REST API logs out the current user in DHIS2 App

Hello,

I have a DHIS2 app that calls DHIS Rest API to retrieve tracked entities, whenever I’m using the App and I reach to the point of calling needed API it signs the current user out and signs in the API user. any help would be appreciated.

Thanks,

Hi @Orly_MUGWANEZA,
I move your post to the Development category. Would you share more info such as the code (without including any sensitive info). Thank you!

I believe you are probably being impacted by this bug: Log in - DHIS 2 JIRA

1 Like

I think I have spotted the issue. To call DHIS2 REST API we need to authenticate first, hence it signs out the current user and signs in the authenticated user for API calls.

Do we have any other way to call DHIS2 REST API without having to authenticate?

I found what was going wrong. I was calling REST API manually instead of leveraging the DHIS2 application runtime designed for that purpose.

2 Likes