Share via

Issue with doing Certificate Based Authentication to Graph API from Java code

Ashish Jhunjhunwala 0 Reputation points
Feb 22, 2023, 6:55 PM

I have done. as suggested in the documentation where x5t is based on certificate thumbprint while the JSW token is signed with private key of the certificate. I also updated the certificate in the app (xanadufinancials.com domain).

While. trying to add I am geting. below error:

,"error_description":"AADSTS700027: The certificate with identifier used to sign the client assertion is not registered on application. [Reason - The key was not found., Thumbprint of key used by client: '37313131413430454539363337333431434431374131443745444545353437443635433542333541', Please visit the Azure Portal, Graph Explorer or directly use MS Graph to see configured keys for app Id 'd9e98c63-d918-4f05-b859-e077acbed37c'. Review the documentation at https://docs.microsoft.com/en-us/graph/deployments to determine the corresponding service endpoint and https://docs.microsoft.com/en-us/graph/api/application-get?view=graph-rest-1.0&tabs=http to build a query request URL, such as 'https://graph.microsoft.com/beta/applications/d9e98c63-d918-4f05-b859-e077acbed37c'].\r\nTrace ID: b1b49b1d-7244-4531-b8a8-df53cf3a1b00\r\nCorrelation ID: c7bdea9d-f335-4851-9edf-bc507c88c1bf\r\nTimestamp: 2023-02-22 18:29:39Z","error_codes":[700027],"timestamp":"2023-02-22 18:29:39Z","trace_id":"b1b49b1d-7244-4531-b8a8-df53cf3a1b00","correlation_id":"c7bdea9d-f335-4851-9edf-bc507c88c1bf","error_uri":"https://login.microsoftonline.com/error?code=700027"

Any directions on what could be going. wrong here?

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

2 answers

Sort by: Most helpful
  1. CarlZhao-MSFT 46,316 Reputation points
    Feb 23, 2023, 8:42 AM

    Hi @Ashish Jhunjhunwala

    Please use Base64 format to encode your certificate thumbprint.

    Reference certificate credentials:

    User's image

    Hope this helps.

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


  2. Ashish Jhunjhunwala 0 Reputation points
    Feb 23, 2023, 1:18 PM

    I have used that only to use in x5t Is there any other thing to be done. I did the following:

    1. Created self signed certificate
    2. Uploaded into Application under Certificates
    3. Build JWT token to send as. client_assertion The Token is being signed using private key from certificate generated in. (1)

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.