0

i've updated my Project to Spring Boot 3 and now im confused how to "activate" Azure AD. In Spring Boot 2 i've extended with AADResourceServerWebSecurityConfigurerAdapter and nothing else to do, but since the latest spring security version inheritence is not more possible and @Bean Configuration is now the thing. I'm new to spring boot and found nothing that helped me, tried to find any tutorial but everything i've found still uses the old approach. I have an Angular GUI with PKCE and this app tries to talk with a Spring Boot Backend. In Spring Boot 2 all works fine.

Thanks for every hint or help

Used Dependencies:

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-oauth2-client</artifactId>
    </dependency>
    <dependency>
        <groupId>com.azure.spring</groupId>
        <artifactId>azure-spring-boot-starter-active-directory</artifactId>
        <version>4.0.0</version> 
    </dependency>
meiksner
  • 13
  • 3
  • Version 4 is old and won't work with Spring Boot 3 I suspect (as it requires earlier versions of both Spring Boot and Spring Secuirty). You probably need the 5.0.0 version of the azure starter, which should work with Spring Security 6 (judging from the dependencies). – M. Deinum Feb 23 '23 at 12:40
  • com.azure.spring:azure-spring-boot-starter-active-directory:4.0.0 is the latest version. is there a another artifact or group ? – meiksner Feb 23 '23 at 12:56
  • That is the old artifact it has been relocated. See [this location](https://search.maven.org/artifact/com.azure.spring/spring-cloud-azure-starter-active-directory/5.0.0/jar). You also need to upgrade Spring Cloud if you have an explicit dependency on that else you run with incompatible versions as Spring Cloud is tied to certain Spring Boot versions!. – M. Deinum Feb 23 '23 at 13:00
  • What is this spring application : a Gateway (configured with TokenRelay) or a REST API? Is your Angular app àn OAuth2 public client (exchanges tokens) or is it secured with just sessions on a BFF? – ch4mp Feb 23 '23 at 14:11
  • Frontend is Angular open client with pkce, backend is rest-api – meiksner Feb 24 '23 at 08:39

1 Answers1

0

Spring Boot 3 is compatible with Spring Cloud Azure Starter Active Directory 5.0.0

You can refer to this documentation

G. Scimeca
  • 36
  • 2