Skip to content

Access API file downloads do not work with Bearer Token authentication on draft datasets. #11740

@GPortas

Description

@GPortas

What steps does it take to reproduce the issue?

This issue can be easily reproduced from the SPA, which uses the bearer token authentication mechanism. Files in a dataset’s draft version are subject to permission checks to ensure that the user attempting to download them has the necessary access rights. The Access API currently relies on the Dataverse session (via the JSESSIONID cookie) to verify user permissions.

We need to decouple the Access API from this responsibility, so that it validates permissions for the authenticated user provided by the API authentication filter—regardless of the authentication mechanism used. In the SPA’s case, this is a bearer token.

At present, there are multiple references to DataverseSession within the Access API. When implementing these changes, it’s important to maintain backward compatibility, since JSF uses these endpoints and relies on the session cookie authentication mechanism.

This is the error we are obtaining from the SPA when attempting to download a file from a draft dataset version:

Image
  • When does this issue occur?

Download files from a draft version using the access API

  • Which page(s) does it occurs on?

SPA Dataset page

  • What happens?

We encounter an API error and files are not downloaded.

  • To whom does it occur (all users, curators, superusers)?

SPA and API users

  • What did you expect to happen?

Files to be correctly downloaded from draft versions.

Which version of Dataverse are you using?

Latest

Are you thinking about creating a pull request for this issue?
Help is always welcome, is this bug something you or your organization plan to fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    FY26 Sprint 4FY26 Sprint 4 (2025-08-13 - 2025-08-27)FY26 Sprint 5FY26 Sprint 5 (2025-08-27 - 2025-09-10)FY26 Sprint 6FY26 Sprint 6 (2025-09-10 - 2025-09-24)FY26 Sprint 7FY26 Sprint 7 (2025-09-24 - 2025-10-08)GREI Re-archIssues related to the GREI Dataverse rearchitectureOriginal size: 50SPA.Q3.2025Not related to any specific Q3 2025 featureSize: 50A percentage of a sprint. 35 hours.Type: Buga defect

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions