What all certificates are required to generate token using client secret?

Rutik Katkamwar 0 Reputation points
2023-06-06T02:20:29.7266667+00:00

Hello,

I am using Microsoft graph Apis in my java application for that I have added following two dependency in my pom.xml file

		<dependency>
			<groupId>com.microsoft.graph</groupId>
			<artifactId>microsoft-graph</artifactId>
			 <version>5.59.0</version>
		</dependency>
		<dependency>
			<groupId>com.azure</groupId>
			<artifactId>azure-identity</artifactId>
			 <version>1.2.5</version>
		</dependency>

when trying to retrieve the Access token, I receive the following certificates error

client.HttpClientConnect - [087ed0a7, L:/10.200.221.79:51413 - R:login.microsoftonline.com/40.126.17.132:443] The connection observed an error
javax.net.ssl.SSLHandshakeException: General OpenSslEngine problem

Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Caused by: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

I have already imported certificate of graph.microsoft.com/v1.0/ **and *login.microsoftonline.com ***using key tools.

what am I missing here?

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