-
Version InformationServer Version: Environmenthasura:2.1.1/docker What is the expected behaviour?Editor shouldn't be able to insert posts. Keywordspermissions roles jwt x-hasura-allowed-roles What is the current behaviour?I can insert posts with the following JWT: Why? How to reproduce the issue?
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
Someone correct me if I'm wrong, but I believe, following https://hasura.io/docs/latest/graphql/core/auth/authentication/jwt.html#tl-dr:
That JWT (ignoring the |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply, it makes sense how you describe it, but when using JWT, i maybe don't want to use other request headers anymore. Why should hasura ignore the x-haura-role claim in the JWT? Maybe this should not be reported as a bug, but a change request.. Background: I am using keycloak as an auth-provider, mapping the real User Client Role (defined in keycloak) to the x-hasura-role JWT claim. |
Beta Was this translation helpful? Give feedback.
-
If you want to have the client use a particular role, say 'editor' in this case, would the following not work?
both in the JWT. |
Beta Was this translation helpful? Give feedback.
Someone correct me if I'm wrong, but I believe, following https://hasura.io/docs/latest/graphql/core/auth/authentication/jwt.html#tl-dr:
x-hasura-role
within the JWT is probably not what you want, you'd want to pass it as a request headereditor
instead of[editor]
That JWT (ignoring the
x-hasura-role
key) allows making requests as bothuser
andeditor
. If nox-hasura-role
header is passed, it will be made asuser
.