Skip to content

New filter-based design for the API authentication mechanisms #9293

@GPortas

Description

@GPortas

Overview of the Feature Request

Instead of calling the AbstractApiBean's findUserOrDie method on each secured endpoint to authenticate the request through one of the possible authentication credentials, this responsibility can be delegated to an outer layer. Since Dataverse already uses the JAX-RS standard in its API, the layer would nominally be a JAX-RS ContainerRequestFilter doing authentication/revalidation as a PreMatch operation which would either reject the request (if authentication fails) or pass the request to the underlying API method with the logged in user account info included. To mark API endpoints that require authentication and therefore filtering, a custom annotation can be used.

This new design would support Dataverse’s existing API authentication methods into such a filter (or another one(s) - filters can be stacked). This may be most straight-forward for the stateless SignedURL mechanism. The other mechanisms, which require Database lookups, could also be moved to a filter but would still have dependencies on internal Dataverse code.

This new design improves the testability and extensibility of the API authentication mechanisms.

(Specification extracted from Dataverse - SPA Authentication document)

What kind of user is the feature intended for?

API User, future SPA user

What inspired the request?

  • Re-Architecture decisions for Dataverse Authentication and related Proof Of Concept (PoC) developed.
  • Dataverse - SPA Authentication document

PoC repository link: https://github.com/GPortas/dataverse/tree/poc/api_security_filter

What existing behavior do you want changed?

AbstractApiBean's findUserOrDie method

Any brand new behavior do you want to add to Dataverse?

JAX-RS ContainerRequestFilter for authentication/revalidation

Any related open or closed issues to this feature request?

The API auth mechanisms requested in these issues should be part of the new filter-based mechanism.

Metadata

Metadata

Assignees

Labels

FY26 Sprint 4FY26 Sprint 4 (2025-08-13 - 2025-08-27)Feature: APINIH OTA: 1.7.1 (reArchitecture)7 | 1.7.1 | Research & architecture for separating backend and frontend to enable a flexible, sca...Size: 30A percentage of a sprint. 21 hours. (formerly size:33)User Role: API UserMakes use of APIspm.GREI-d-1.7.1NIH, yr1, aim7, task1: Research & architecture for separating backend and frontend

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions