microsoft-authentication-library-for-java icon indicating copy to clipboard operation
microsoft-authentication-library-for-java copied to clipboard

How to create ClientCredential with private and certificate thumbprint?

Open yongheyan opened this issue 3 years ago • 2 comments

In MSAL for Python, I can create client_credential with private key and certificate thumbprint. However, I could not find a way to do the same in MSAL for Java. ClientCredntialFactory only has a method to create client credential with private key and the certificate. I am wondering how I can create ClientCredential with private key and certificate thumbprint? If it is not supported now, please add this feature so that users can create ClientCredential with private key and certificate thumbprint.

yongheyan avatar Feb 25 '22 19:02 yongheyan

Hello @yongheyan : Sorry for the delayed response. Currently we have methods for using a private key/certificate, client secret (from Azure AD mainly), and JWT client assertions, but not with a private key/certificate thumbprint. You can try looking into JWT assertions, there may be a way to sign them in a way that works best for you but I'm not sure about all of the options.

We'll discuss covering this scenario and I'll update this thread once we have it added or have more info.

Avery-Dunn avatar Mar 07 '22 19:03 Avery-Dunn

@yongheyan - you can create your own assertion or provide a certificate. MSAL will create a JWT and sign it with your cert, and also use the certificate's thumbprint.

@Avery-Dunn - do we have a sample / code snippet that shows how to create bring your own assertion?

bgavrilMS avatar May 01 '23 12:05 bgavrilMS