Skip to content

Unauthorized on dotnet graph init with bearer token #8266

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

Open
Ramedlaw-knil opened this issue Apr 29, 2025 · 0 comments
Open

Unauthorized on dotnet graph init with bearer token #8266

Ramedlaw-knil opened this issue Apr 29, 2025 · 0 comments

Comments

@Ramedlaw-knil
Copy link

Product

Strawberry Shake

Version

15.1.3

Link to minimal reproduction

https://pastebin.com/4XBLwwPY

Steps to reproduce

  1. Get a token from your identity provider
  2. execute dotnet graphql init https://my-url/graphql --scheme Bearer --token $Token

What is expected?

The graphql schema of the graphql server should be loaded and saved locally.

What is actually happening?

I get an unauthorized error and not schema is loaded.

Relevant log output

Download schema started.
error HTTP_ERROR: Response status code does not indicate success: 401 (Unauthorized).

Additional context

The token i used for the test is valid and has enough rights.
i tested it by doing a curl requests with the introspection query from this page:
http://nathanrandal.com/graphql-visualizer/

I already talked with someone from the hot chocolate slack channel who told me that it is because strawberryshake is sending the scheme Bearer in lower case. Therefore I assume "bearer" is send in the authorization header.

The workaround would be to load the schema on my own, save it into a file and do the init step with the file.
This is possible but it would be cleaner if the init command would work with bearer tokens.

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

No branches or pull requests

1 participant