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

can't delete auth-app token using the token received from auth-app create request #10675

Closed
Tracked by #10619
nirajacharya2 opened this issue Nov 27, 2024 · 3 comments
Closed
Tracked by #10619
Labels

Comments

@nirajacharya2
Copy link
Contributor

nirajacharya2 commented Nov 27, 2024

Describe the bug

Can't delete auth-app token using the token received from create request but deleting with the token that we get when listing works.

Steps to reproduce

1.create auth-token

curl -kv -XPOST "https://localhost:9200/auth-app/tokens?expiry=72h" -uadmin:admin

{
  "token": "f8qn1azv53d946l0",
  "expiration_date": "2024-11-30T15:18:09.335444969+05:45",
  "created_date": "2024-11-27T15:18:09+05:45",
  "label": "Generated via API"
}
  1. delete the token
curl -kv -XDELETE "https://localhost:9200/auth-app/tokens?token=f8qn1azv53d946l0" -uadmin:admin

Expected behavior

the auth token should be deleted

Actual behavior

{ [122 bytes data]
< HTTP/1.1 500 Internal Server Error
< Content-Length: 0

the auth token is not deleted

Setup

ocis/bin/ocis auth-app server

ownCloud Web UI 11.0.4 
 Infinite Scale 7.0.0-rc.3+98d9cb8d16 Community

Additional context

Under the example for deleting a token the shorter token is used.

@mmattel
Copy link
Contributor

mmattel commented Nov 28, 2024

@2403905 fyi

@nirajacharya2 nirajacharya2 changed the title can't delete auth-app token can't delete auth-app token using the token received from auth-app create request Jan 15, 2025
@saw-jan
Copy link
Member

saw-jan commented Jan 17, 2025

I wonder if the difference in tokens while creating and listing is the expected one.
CC @2403905

@saw-jan
Copy link
Member

saw-jan commented Jan 17, 2025

After talking with @2403905, found out that the token creation request returns the actual token and the list request return the id of that token. And the actual token is only available in the creation response (after that we cannot request the token value in any way). This is by design.

So that means, we have to use token-id from list request to delete the token. And the current behavior is correct

@saw-jan saw-jan closed this as completed Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants