Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

GraphiQL starter is not compatible with Spring security #253

Closed
jonrimmer opened this issue Jun 1, 2019 · 1 comment
Closed

GraphiQL starter is not compatible with Spring security #253

jonrimmer opened this issue Jun 1, 2019 · 1 comment
Labels
Milestone

Comments

@jonrimmer
Copy link

Spring Security enables CSRF protection by default and thus requires the CSRF token header on POST requests to the /graphql endpoint. If Spring Security is loaded and CSRF protection is not disabled, the /graphiql endpoint will get a 403 error when it tries to access the /graphql endpoint.

GraphiQLController should check the _csrf attribute in the request and, if it exists, use the header name and the token it contains to add a header to the headers collection used by the fetcher function supplied to GraphiQL.

BlasiusSecundus added a commit to BlasiusSecundus/graphql-spring-boot that referenced this issue Jun 2, 2019
@oliemansm oliemansm added the bug label Jun 19, 2019
@oliemansm oliemansm added this to the 5.9.1 milestone Jun 20, 2019
@oliemansm
Copy link
Member

Thanks for reporting it, fixed this in 5.9.1

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

No branches or pull requests

2 participants