-
Notifications
You must be signed in to change notification settings - Fork 535
Description
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?
- As a developer, I'd like to use Bearer Token to send authenticated API requests #9229
- New API auth mechanism for SPA frontend requests to APIs (developers only for now) #9063
The API auth mechanisms requested in these issues should be part of the new filter-based mechanism.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status