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

Admin-scope token or: How to get hidden objects #185

Open
famfop opened this issue Jan 2, 2025 · 6 comments
Open

Admin-scope token or: How to get hidden objects #185

famfop opened this issue Jan 2, 2025 · 6 comments
Assignees

Comments

@famfop
Copy link

famfop commented Jan 2, 2025

Hi, this is probably intended but:

As a administrator I want to run some sync scripts, but if I GET the space endpoint, I get a list of public spaces and my personal spaces. Is there a way to get all spaces, or: is there a way to create an admin-scoped token such that I may access everything?

If not, what would you suggest? I assume there are two possible work-arounds for this:

  1. Use some sort of admin bot-account
  2. Impersonate a designated space-admin for each space

What would you suggest

@luke-
Copy link
Contributor

luke- commented Jan 4, 2025

@gevorgmansuryan Do you have an idea here?

@famfop
Copy link
Author

famfop commented Jan 16, 2025

Hi, is there any update on this?

@gevorgmansuryan
Copy link
Contributor

gevorgmansuryan commented Jan 20, 2025

@famfop you can create admin scope token at Administration -> Modules -> RESTful API -> Configure. Then enable Allow Bearer Authentication, then go to Bearer Auth tab and create token for admin user. With admin bearer token you will be able to see all spaces.

@famfop
Copy link
Author

famfop commented Jan 20, 2025

Not sure if I am missing something but the steps you explain are exactly what I did. With that listing all spaces with
GET /api/v1/space does list 13 spaces. which is exactly all spaces (public + my private) that I can see. Instance-wide through the admin page I do see many more.

I did find a work-around by impersonating a user that I know is member of the space in order to get info about that space but I guess some sort of parameter (to restrict to public/private spaces or without parameter list all) would be very helpful. Am I missing something?

@gevorgmansuryan
Copy link
Contributor

@famfop strange. Do you have an access to database?

@famfop
Copy link
Author

famfop commented Jan 22, 2025

Sorry, just saw your answer. I could get it. What information do you need?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants