title: Secure a Java web app using the Spring Boot Starter for Azure Active Directory JWT token algorithm problem
body: <p>I'm created java web application using spring boot starter for azure active directory step by step like is described in:<a href="https://docs.microsoft.com/en-us/azure/developer/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-active-directory" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/developer/java/spring-framework/configure-spring-boot-starter-java-app-with-azure-active-directory</a></p>
  <p>My application with my azure account work fine when i open localhost:8080 it redirects me to azure where I do the login and then I'm redirected back to my app.</p>
  <p>Problem is when i try to configure this dummy app with azure AD account from my customer. Here also when i open my app host app redirects me to azure login and after login i got error like in screenshot<a href="https://i.stack.imgur.com/wCV4w.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wCV4w.png" alt="enter image description here" /></a></p>
  <p>and here is my application.properties</p>
  <pre><code>azure.activedirectory.tenant-id=placeholder 
  
  azure.activedirectory.client-id=placeholder 
  azure.activedirectory.client-secret=placeholder 
  azure.activedirectory.object-id=placeholder 
  
  
  azure.activedirectory.user-group.allowed-groups=group1 
  azure.activedirectory.session-stateless=true
  
  
  security.oauth2.authorization.token-key-access=permitAll() 
  spring.thymeleaf.prefix=classpath:/templates/
  spring.thymeleaf.suffix=.html
  application.baseurl.logout.redirect=https://mydomain:8081/
  
  application.groups.for.displaying=
  application.groups.for.filtering=
  server.port=8081
  
  
  
  server.ssl.enabled=true 
  server.ssl.trust-store=/apps/tomcat/conf/trusted.jks 
  server.ssl.trust-store-password=mykeys 
  
  
  server.ssl.key-store=/apps/tomcat/conf/.keystore 
  server.ssl.key-store-password=f213495a0be855c4ab190a1f84cc18cd 
  server.ssl.key-store-type=JKS
  
  server.ssl.key-alias=key-dev-ui 
  server.ssl.key-password=f213495a0be855c4ab190a1f84cc18cd
  </code></pre>
  <p>my configuration:</p>
  <pre><code> @Override
      protected void configure(HttpSecurity http) throws Exception {
  
          http.cors().and().csrf().disable().authorizeRequests().anyRequest().authenticated().and().oauth2Login().and().csrf()
                  .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse())
                  .and().oauth2Client();
      }
  </code></pre>