# Java authorizeRequests().permitAll() not working

**URL:** <https://community.auth0.com/t/java-authorizerequests-permitall-not-working/86588>\
**Category:** Get Help\
**Tags:** java\
**Created:** [July 7, 2022, 10:43am UTC](https://community.auth0.com/t/java-authorizerequests-permitall-not-working/86588 "2022-07-07T10:43:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dennis2](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dennis2/32/33259_2.png) [@dennis2](https://community.auth0.com/u/dennis2)\
**Post date:** [July 7, 2022, 10:43am UTC](https://community.auth0.com/t/java-authorizerequests-permitall-not-working/86588/1 "2022-07-07T10:43:34Z")

</div>

Using the code from the Quickstart guide and running into issues.

```auto
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
	@Override
	protected void configure(HttpSecurity http) throws Exception {
		http.authorizeRequests()
				//.mvcMatchers(HttpMethod.GET, "/api/menu/items/**").permitAll() // GET requests don't need auth
				.mvcMatchers("/webhook/**")
				.permitAll() // Allow webhook calls
				.and()
				.authorizeRequests()
				.anyRequest()
				.authenticated()
				.and()
				.oauth2ResourceServer()
				.jwt()
				.decoder(jwtDecoder());
	}

```

My understanding is this should allow calls to /webhook to pass freely, but it’s not working as expected. My webhook calls are getting authenticated and throwing 401 errors. What’s wrong?

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [March 10, 2025, 8:13pm UTC](https://community.auth0.com/t/java-authorizerequests-permitall-not-working/86588/3 "2025-03-10T20:13:01Z")

</div>

Hi @dennis2

Welcome to the Auth0 Community!

I am sorry about the late reply to your inquiry regarding the matter.

I would highly recommend to review the following post from StackOverflow since it covers some points to why .permitAll() might not function properly for the specified endpoint:

- [java - Spring Boot - permitAll not working using SecurityFilterChain - Stack Overflow](https://stackoverflow.com/questions/76084548/spring-boot-permitall-not-working-using-securityfilterchain)

Please also keep in mind that `authorizeRequests()` has been deprecated and replace by `authorizeHttpRequests()`. You can also check if you are passing the necessary `scopes` and `audience` in your requests.

If you have any other questions, feel free to reply or post again on the community!

Kind Regards,  
Nik

Otherwise, you can review our blog post regarding [Spring Boot Authorization](https://auth0.com/blog/spring-boot-authorization-tutorial-secure-an-api-java/) since you might have overlooked a step.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [March 24, 2025, 8:13pm UTC](https://community.auth0.com/t/java-authorizerequests-permitall-not-working/86588/4 "2025-03-24T20:13:57Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
