OHDSI / OHDSI/WebAPI

Some API endpoints return 403 (WebAPI and Atlas v2.12.0)

Open
#2,151 0 comments 0 reactions 2 assignees View on GitHub

@ssuvorov-fls is already working on this.

Since Nov 4, 2022.

Dominant language
Java
Stars
151
Forks
183
Avg merge
14m
Merged PRs (30d)
2

Description

Expected behavior

When using an admin user's token, cURL on endpoints such as http://www.example.com/user/userId/permissions/ should return the data specified in the API documentation.

Actual behavior

The command fails with return code 403. Most endpoints work as expected (listing users or roles, creating sources for example).
The logs do not provide any information pertaining to this error.

Steps to reproduce behavior

Assign admin role (and every available permission to ensure it is not the issue) to a user, then generate a token and use it to query WebAPI for a specific user's roles for instance.

ADMIN_USERNAME="ohdsi"
ADMIN_PASSWORD="ohdsi"
WEBAPI_BASE_URL="http://webapi:8080"
TOKEN=$(curl -s -o /dev/null -D - -k --data "login=${ADMIN_USERNAME}&password=${ADMIN_PASSWORD}" "${WEBAPI_BASE_URL}/WebAPI/user/login/db" | sed -n -e 's/Bearer: //p')

curl -k -H "Authorization: Bearer ${TOKEN}" -X GET "${WEBAPI_BASE_URL}/WebAPI/user/1000/roles"

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.