Dude, have you solved your problem? I have encountered the same problem as you
com.azure.identity.ClientSecretCredential - Azure Identity => ERROR in getToken()
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("https://graph.microsoft.com/.default");
final ClientSecretCredential credential = new ClientSecretCredentialBuilder()
.clientId(clientId).tenantId(tenantId).clientSecret(clientSecret).build();
if (null == scopes || null == credential) {
throw new Exception("Unexpected error");
}
final TokenCredentialAuthProvider authProvider = new TokenCredentialAuthProvider(
scopes, credential);
final GraphServiceClient<Request> graphClient = GraphServiceClient.builder()
.authenticationProvider(authProvider).buildClient();
/// 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 com.azure.identity.ClientSecretCredential - Azure Identity => ERROR in getToken() call for scopes [https://graph.microsoft.com/.default]: Could not initialize class reactor.netty.http.client.HttpClientSecure