Unable to call Graph API through IBM BPM

Manju Sudan 0 Reputation points
2023-03-01T21:55:31.0466667+00:00

I am integrating Graph API to get email messages using java in IBM BPM. The integration throws error "unable to find valid certification path to requested target". I have imported certificates for "login.microsoftonline.com" and "graph.microsoft.com" onto java cacerts file. The code works locally but fails when run in IBM BPM environment.

Following code works without error:

GraphServiceClient.builder().authenticationProvider(tokenCredentialAuthProvider).buildClient();

But fails when getting messages:

graphServiceClient.users(mailbox).mailFolders("inbox").messages().buildRequest().get();

Any help is appreciated.

Thank you

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. HarmeetSingh7172 4,826 Reputation points
    2023-03-21T20:44:04.2566667+00:00

    Hello Manju Sudan,

    Thanks for reaching out!

    As per my research, "unable to find valid certification path to requested target" is not a specific error message from the Graph API, but rather a generic SSL/TLS error message that indicates a problem with the SSL/TLS certificate validation. This error is typically thrown by the Java SSL/TLS implementation when it's unable to establish a secure connection with the server due to an invalid or untrusted SSL/TLS certificate.

    In the case of integrating with the Graph API, this error can occur if the SSL/TLS certificate presented by the Graph API server is not trusted by the Java client application, either because the certificate is invalid, expired or not issued by a trusted certificate Authority.

    Please ensure that the app trusts the provided certificate, in order to establish a connection successfully.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.