I have a user created in Azure Active Directory and i'm trying to read it's properties / attributes but i'm getting an error.
here is my code:
UsernamePasswordProvider authProvider = new UsernamePasswordProvider(clientId, Collections.singletonList("https://graph.microsoft.com/.default"),
username, password, NationalCloud.Global, tenantId, clientSecret);
GraphServiceClient<Request> graphClient = GraphServiceClient
.builder()
.authenticationProvider(authProvider)
.buildClient();
User user = graphClient.me().buildRequest().get();
System.out.println(user.companyName);
the error I get is :
SEVERE: Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: com/microsoft/graph/httpcore/ICoreAuthenticationProvider] with root cause
these are the dependencies im using:
<dependency>
<groupId>com.microsoft.graph</groupId>
<artifactId>microsoft-graph</artifactId>
<version>5.34.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.graph</groupId>
<artifactId>microsoft-graph-core</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.microsoft.graph</groupId>
<artifactId>microsoft-graph-auth</artifactId>
<version>0.3.0</version>
</dependency>
Thank You.