Judy Guo
Judy Guo

Reputation: 1

403 in localhost:8080/graphiql

I am working on a springboot application. I just started the project and am not in the stage to add any security rules/filters yet. I am using graphql-spring-boot-starter, graphiql-spring-boot-starter and spring-boot-starter-security

I have the following configuration in application.properties:

graphql.graphiql.enabled=true
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                .antMatchers("/graphql").permitAll() // Permit access to the GraphQL endpoint
                .antMatchers("/graphiql").permitAll()
                .anyRequest().authenticated()
                .and()
                .csrf().disable();
    }
}

Here is the error

Access to localhost was denied
You don't have authorization to view this page.
HTTP ERROR 403

Upvotes: 0

Views: 22

Answers (0)

Related Questions