- Azure Identity => ERROR in getToken()

Karunaker Reddy V 5 Reputation points

I'm trying to use Microsoft Azure Graph API to access groups, apps, users, auditlog data.

I have valid clientID, client secret, tenantid and consent granted scopes and I've tried accessing the same API's from postman and those are working properly but when I use Graph SDK fro Java from microsoft(Github) with below code (which is a sample from microsoft documentation)

final String clientId = "YOUR_CLIENT_ID";
final String tenantId = "YOUR_TENANT_ID";
final String clientSecret = "YOUR_CLIENT_SECRET";

// The client credentials flow requires that you request the
// /.default scope, and pre-configure your permissions on the
// app registration in Azure. An administrator must grant consent
// to those permissions beforehand.
final List<String> scopes = Arrays.asList("");

final ClientSecretCredential credential = new ClientSecretCredentialBuilder()

if (null == scopes || null == credential) {
    throw new Exception("Unexpected error");
final TokenCredentialAuthProvider authProvider = new TokenCredentialAuthProvider(
    scopes, credential);

final GraphServiceClient<Request> graphClient = GraphServiceClient.builder()

/// below is the line I've wrote to get groups for the given tenant/client
GroupCollectionPage groupList = graphClient.groups().buildRequest().get();

on executing the above code getting below error

[ForkJoinPool.commonPool-worker-19] ERROR - Azure Identity => ERROR in getToken() call for scopes []: Could not initialize class reactor.netty.http.client.HttpClientSecure

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,421 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. Brandon Liu 0 Reputation points

    Dude, have you solved your problem? I have encountered the same problem as you