-
Notifications
You must be signed in to change notification settings - Fork 23
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
Requests failing with public schema disabled #52
Comments
@GMConsultant I'm not overly familiar with |
in Craft CMS documentation ( https://craftcms.com/docs/3.x/graphql.html#sending-api-requests ) Querying a Private Schema it's explained: If you’re unable to query a private schema because of a “missing authorization header”, make sure Craft received it from the web server with a quick post to a test template:
Apache strips Authorization headers by default, which can be fixed by enabling CGIPassAuth (opens new window)or adding the following to your .htaccess file:
in version 1.7.0 was necessary... |
@GMConsultant interesting, thanks for the reference. I use |
yes... So could it be something in the NEW version of Craft Cms? |
@GMConsultant It's certainly possible that #48 slightly changed the behaviour. If it works fine without the rule I'd go ahead with that 👍 I'll pin this issue so it's visible to other users who may have a similar setup to you. |
Hi James,
If I enable the htaccess directive ( after login ) all are ok. There is a Authorization header problem into the plugin.... |
@jamesedmonston we've noticed this happening since upgrading (I think it happened at 1.9.0) using Nginx via Forge. We now get
But looking at the headers sent, we're definitely sending a JWT authorization header And the authorization header is in the |
@andrewfairlie Huh, sorry about that. I'll take another look – strange as we haven't had this issue on any Nginx projects. Are you on the latest version ( |
Yep, 1.10.3. Let me know if I can help at all. |
@andrewfairlie I've narrowed down the issue – will have a fix up shortly! |
@andrewfairlie just to confirm, do you have your public schema enabled or disabled? |
The public schema is disabled. |
Cool, thanks. As an interim fix you can enable the public schema. |
Cool that worked 👍 |
Any updates related to this isue? |
@jornwildenbeest Are you experiencing the issue even with the public schema enabled? I can see where the issue is, but haven't yet found a way of fixing it. In the meantime you can enable your public schema and disable introspection by setting https://craftcms.com/docs/3.x/config/config-settings.html#enablegraphqlintrospection to |
@jamesedmonston Sorry for the late response. I found out that my issue was caused by some time difference between the server and the database. Goodluck with this issue! |
To anyone following this issue, I don't think there's going to be a way to get it functioning with the public schema disabled. There seems to be a race condition where Craft's internal methods are checking for it before I am injecting the schema from the JWT. I'll add a note to the docs so that it's clear for everyone. It's worth looking into https://craftcms.com/docs/3.x/config/config-settings.html#enablegraphqlintrospection to disable introspection queries on your production endpoint. |
@jamesedmonston I just purchased your plugin and was coming across this issue. I was pulling my hair out and finally found this. I scoured the docs and didn't see ANYTHING about needing to have public schema enabled for things to work. I am guessing you forgot to add it to the docs? If so, can you please do so? Would have saved me about an hour. 😬 Thanks! Everything else has been great so far! |
Hi James,
After the last update I noticed that the htaccess configuration present in my htaccess file:
seems no longer necessary ...
Indeed, this creates a Header Authorization problem.
Can you confirm me if the latest changes impact this configuration?
Craft Pro 3.6.12.1
GraphQL Authentication | 1.8.0
The text was updated successfully, but these errors were encountered: