Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a developer, I'd like to use Bearer Token to send authenticated API requests #9229

Closed
johannes-darms opened this issue Dec 14, 2022 · 0 comments · Fixed by #9591
Closed
Milestone

Comments

@johannes-darms
Copy link
Contributor

johannes-darms commented Dec 14, 2022

Overview of the Feature Request

Dataverse already allows users to register and sign in using OIDC. To access Dataverse APIs, these users must still generate and send a Dataverse API key. Instead, we would like them to be able to access the APIs using OIDC bearer tokens.

What kind of user is the feature intended for?
(Example users roles: API User, Curator, Depositor, Guest, Superuser, Sysadmin)

API users

What inspired the request?

This would simplify the integration of e.g. SPAs with Dataverse when users sign in via OIDC.

What existing behavior do you want changed?

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

OIDC users should be able to access Dataverse APIs by sending an OIDC bearer token in the Authorization header instead of sending their API key.

Any related open or closed issues to this feature request?

#7005 proposed using OAuth 2.0 bearer tokens for API auth.

text written by @vera

poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 14, 2022
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 14, 2022
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 14, 2022
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 14, 2022


- Expose the UserInfo endpoint URI from the OIDC provider metadata
- Not exposing the complete metadata on purpose to keep it
  non-modifiable and sealed inside the provider instance
- Minor method renaming to better explain what the method is about
- Fix missing newlines for single line method
poikilotherm added a commit to poikilotherm/dataverse that referenced this issue Dec 14, 2022
Replace the placeholder of static endpoint with retrieving the UserInfo
endpoint URI from all know OIDC authentication providers and iterate
over them. The access token might match for any of them.

Also making the errors a bit more descriptive and adding logging.
pdurbin added a commit to pdurbin/dataverse that referenced this issue May 10, 2023
johannes-darms pushed a commit to johannes-darms/dataverse that referenced this issue May 15, 2023
pdurbin added a commit to johannes-darms/dataverse that referenced this issue May 17, 2023
Co-authored-by: Oliver Bertuch <poikilotherm@users.noreply.github.com>
pdurbin added a commit to johannes-darms/dataverse that referenced this issue May 17, 2023
@pdurbin pdurbin added this to the 5.14 milestone May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment