Azure JWT Authentication not working after upgrade

hi Experts,

we have upgraded camunda from 7.19 to 7.20.0 and upgraded spring boot from 2.5 to 3.0 and have changed configuration to register authentication filters accordingly.
But after upgrade, engine-rest endpoints are not getting authenticated by JWT token.

Below code snippet is the one I am using to protect endpoints.
Just to mention, our custom endpoint /custom is working fine and is protected

@Order(1)
	@Configuration
	public  class ApiHttpSecurityConfiguration {
		@Bean
		public SecurityFilterChain apiFilterChain(HttpSecurity http) throws Exception {
			http.apply(AadResourceServerHttpSecurityConfigurer.aadResourceServer()).and().addFilterBefore(camundaRestAuthFilter().getFilter(), UsernamePasswordAuthenticationFilter.class).
			securityMatcher("/custom/**", "/engine-rest/**").authorizeHttpRequests().anyRequest().authenticated();
			http.csrf((csrf) -> csrf.disable());
			http.anonymous(anonymous -> anonymous.disable());
			return http.build();
		}

		@Bean
		public FilterRegistrationBean  camundaRestAuthFilter() {
			// ProcessEngineAuthenticationFilter sets the authentication details to the
			// Camunda Rest Api
			FilterRegistrationBean filterRegistration = new FilterRegistrationBean<>();
			filterRegistration.setFilter(new ProcessEngineAuthenticationFilter());
			filterRegistration.setInitParameters(Collections.singletonMap("authentication-provider", ContainerBasedAuthenticationProvider.class.getCanonicalName()));
			filterRegistration.setOrder(103); // make sure the filter is registered after the Spring Security Filter Chain
			filterRegistration.addUrlPatterns("/engine-rest/*", "/custom/*");
			return filterRegistration;
		}
	}

can someone send me any link of working azure ad rest authentication with camunda version 7.20 (or any github repo url)

Hello my friend!

Did you update your JWT library when you updated your Spring version?
Besides Spring and Camunda, have you reviewed their other libraries and dependencies?

Many things “break” when upgrading spring from 2.x to 3.x. :neutral_face:

William Robert Alves

I had the same problem. Please try to use the deprecated method authorizeRequests Instead of authorizeHttpRequests. It seems like ContainerAuth is not yet compatible with AuthorizeHttpRequests