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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 Bug: API giving 403 after latest update #7141

Closed
1 task done
sph33r opened this issue Dec 2, 2023 · 8 comments 路 Fixed by #7169
Closed
1 task done

馃悰 Bug: API giving 403 after latest update #7141

sph33r opened this issue Dec 2, 2023 · 8 comments 路 Fixed by #7169
Assignees

Comments

@sph33r
Copy link

sph33r commented Dec 2, 2023

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Steps to reproduce ?

  • Create a base or use an existing one. I made one with just 2 fields to keep it simple.
  • Generate an API token if you don't have one
  • Open the Rest API screen
  • Authorize your token - pretty sure you just need to use xc-token but I tried in both just in case.
  • Open the Post section to create a new record.
  • Click "Try it out"
  • In Request Body, set your strings as required.
  • Click Execute
  • Server returns 403 Unauthorized

Desired Behavior

I expect the server to authorize my user and insert the new row.

Project Details

Node: v18.17.1
Arch: x64
Platform: linux
Docker: true
RootDB: pg
PackageVersion: 0.202.9

Attachments

No response

@sph33r
Copy link
Author

sph33r commented Dec 2, 2023

I'm the only user of the Base I used for testing and I have Owner access. This is repeatable on all my Base which I am owner on.

I don't see anything new in the Docker logs when I run the above steps and get the 403.

@dstala
Copy link
Member

dstala commented Dec 3, 2023

@sph33r

  • do you see this issue even with auth token?
  • can you try & generate a new token - and try again?

I tried using docker with PG as root DB on 202.9; worked fine for both xc-auth & xc-token.

@sph33r
Copy link
Author

sph33r commented Dec 3, 2023

@dstala
Just tested with auth token and that works fine so I guess it's only the api token. I generated a brand new api token earlier when trying to troubleshoot but just in case, I just created another new one. The api token gives a 403 every time regardless of which one I'm using.

Just in case it was base related, I created a brand new base with a new table and fields, then I generated another new api token and I get a 403 when trying to post a new record.

@KefanAn
Copy link

KefanAn commented Dec 5, 2023

@dstala @sph33r
I just upgraded to latest and ran into an exact same issue, with docker+202.9.
If a token was created by an organization level viewer and base level creator account, every request i tried gets a 403.
Another token created by super admin account is working properly.

Could there be any kind of glitch in user authorization managing?

@dstala
Copy link
Member

dstala commented Dec 5, 2023

@KefanAn I am able to reproduce the issue now. Thanks for the details

@KefanAn
Copy link

KefanAn commented Dec 5, 2023

@dstala
Really glad to help.
Btw, apart from the swagger REST api page, is there any easier way for user to find the table id param for api v2?

@dstala
Copy link
Member

dstala commented Dec 5, 2023

Base ID & table ID will be part of URL
http://localhost:3000/#/nc/p3y2l9w3vfkpv20/mwwmuzt9g5o1a7h

Base ID : p3y2l9w3vfkpv20
Table ID : mwwmuzt9g5o1a7h

Field IDs are now easily accessible from multi fields editor context menu.
View IDs are available in view context menu

Screenshot 2023-12-05 at 6 46 37 PM
Screenshot 2023-12-05 at 6 47 16 PM

@KefanAn
Copy link

KefanAn commented Dec 5, 2023

Really appreciate that

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

Successfully merging a pull request may close this issue.

4 participants