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

System creates unwanted API token #9898

Open
philippconzett opened this issue Sep 10, 2023 · 7 comments
Open

System creates unwanted API token #9898

philippconzett opened this issue Sep 10, 2023 · 7 comments
Labels
Feature: API Type: Bug a defect User Role: Superuser Has access to the superuser dashboard and cares about how the system is configured

Comments

@philippconzett
Copy link
Contributor

During the past two years or so I've experienced several times that an API token was created for my user (superuser) without me clicking on the Create Token button.

To illustrate the latest occurrence of this behavior: This morning I created an API token which I needed to run a regular API script. After I ran the script, I revoked the token. I even clicked on other buttons on the page, refreshed the page, and navigated back to check whether no token was defined anymore. The token I used in the script started with "7d2a". When I checked this evening, a new token starting with "2c4d" was displayed.

What steps does it take to reproduce the issue?

  1. Click on your username on the top right of the Dataverse page.
  2. Click on API token.
  3. Create a token and run an API call.
  4. Revoke the token.
  5. After a while, return to the API token page.
  • When does this issue occur?
    Sporadically, as described above.

  • Which page(s) does it occurs on?
    The API Token page.

  • What happens?
    See description above.

  • To whom does it occur (all users, curators, superusers)?
    I've only tested this as a superuser.

  • What did you expect to happen?
    The token being permanently revoked and no new token being created until I create a new one.

Which version of Dataverse are you using?
5.13

Any related open or closed issues to this bug report?
No.

Screenshots:
No.

@qqmyers
Copy link
Member

qqmyers commented Sep 10, 2023

FWIW:
Right now, tokens get created when you use something like a previewer that would require one to exist. As we switch to using signedUrls for external tools, it would be easier to change this behavior. If we changed it today, previewers/explore/config tools for files in draft versions and restricted files would fail unless/until you create an API key manually.

@philippconzett
Copy link
Contributor Author

Ah, thanks. I guess this explains the behavior described above. Should we close the issue?

@jggautier
Copy link
Contributor

jggautier commented Sep 13, 2023

Since it's not easier to change this behavior now, would it be possible to let users know that this might happen? For example, if someone revokes their api token, can they be told that the repository will recreate the token when they use certain external tools?

Otherwise it's misleading. And maybe a security issue?

@pdurbin
Copy link
Member

pdurbin commented Sep 13, 2023

I do think we should somehow inform users that an API token is being created for them. Here's how we talk about these tokens in the User Guide (i.e. treat them with care!):

How Your API Token Is Like a Password

In many cases, such as when depositing data, an API Token is required to interact with Dataverse Software APIs. The word “token” indicates a series of letters and numbers such as c6527048-5bdc-48b0-a1d5-ed1b62c8113b. Anyone who has your API Token can add and delete data as you so you should treat it with the same care as a password.

@philippconzett
Copy link
Contributor Author

Thanks. Yes, that's why I'm kind of paranoid with my superuser API tokens being revoked whenever I don't need them anymore. ;-)

@jggautier
Copy link
Contributor

@donsizemore's also been cautious about managing API tokens, especially tokens belonging to superuser accounts since they're able to do so much on a repository.

@pdurbin pdurbin added Feature: API Type: Bug a defect User Role: Superuser Has access to the superuser dashboard and cares about how the system is configured labels Oct 13, 2023
@pdurbin
Copy link
Member

pdurbin commented Oct 25, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: API Type: Bug a defect User Role: Superuser Has access to the superuser dashboard and cares about how the system is configured
Projects
Status: 🔍 Interest
Development

No branches or pull requests

4 participants