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

When requesting a Guest Token API, error code 422 is reported Subject must be string #32241

Open
3 tasks
temuujinmo4 opened this issue Feb 13, 2025 · 6 comments · May be fixed by #32244
Open
3 tasks

When requesting a Guest Token API, error code 422 is reported Subject must be string #32241

temuujinmo4 opened this issue Feb 13, 2025 · 6 comments · May be fixed by #32244
Labels
api Related to the REST API authentication Related to authentication

Comments

@temuujinmo4
Copy link

temuujinmo4 commented Feb 13, 2025

Bug description

Subject must be string

i sent string

{
  "user": {
    "username": "user",
    "first_name": "user",
    "last_name": "user"
  },
  "rls": [],
  "resources": [{
    "type": "dashboard",
    "id": "myid"
  }],
  "subject": "Dashboar"
}

Screenshots/recordings

No response

Superset version

master / latest-dev

Python version

3.10

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Copy link

dosubot bot commented Feb 13, 2025

Hey @temuujinmo4! 👋 I'm here to help you with bugs, questions, and becoming a contributor. Let's squash those bugs together!

I found a similar open issue regarding the error "Subject must be string" when requesting a Guest Token API. The solution is to ensure that the 'sub' claim in your JWT token is a string. Specifically, change the 'sub' value from an integer to a string. For example, use "sub": "1" instead of "sub": 1 in your token payload [1][2].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other | Bug Report

@temuujinmo4 temuujinmo4 changed the title When requesting a Guest Token API, error code 422 is reported When requesting a Guest Token API, error code 422 is reported Subject must be string Feb 13, 2025
@dosubot dosubot bot added api Related to the REST API authentication Related to authentication labels Feb 13, 2025
@temuujinmo4
Copy link
Author

I dont understand. How i DO ?

@temuujinmo4
Copy link
Author

temuujinmo4 commented Feb 13, 2025

Hey @temuujinmo4! 👋 I'm here to help you with bugs, questions, and becoming a contributor. Let's squash those bugs together!

I found a similar open issue regarding the error "Subject must be string" when requesting a Guest Token API. The solution is to ensure that the 'sub' claim in your JWT token is a string. Specifically, change the 'sub' value from an integer to a string. For example, use "sub": "1" instead of "sub": 1 in your token payload [1][2].

To continue talking to Dosu, mention @dosu.

Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other | Bug Report

Where is sub ?

@hainenber
Copy link
Contributor

There's a PR I've pushed and linked to fix your issue. You can add the config in your superset_config.py for a quick resolution , if needed🤞

@temuujinmo4
Copy link
Author

There's a PR I've pushed and linked to fix your issue. You can add the config in your superset_config.py for a quick resolution , if needed🤞

CRSF url not found

/api/security/csrf_token

GET request

@bmbdlm
Copy link

bmbdlm commented Feb 22, 2025

Superset_app container dotorh PyJwt package-iinhaa version-iig 2.9.0 blgooroi...
Bas token url ni /api/v1/security/csrf_token ?????

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Related to the REST API authentication Related to authentication
Projects
None yet
3 participants