Closed Vighnesh1234 closed 6 months ago
Hi Team,
I am trying to generate a token .
I have a private key( privatekey.pem), thumbprint and certificate file (cert.pem). I dont have a secret.
I was trying to understand and generate token for myself.
From what I understand I should use CertFromPEM then the returned values in the NewCredFromCert.
CertFromPEM has 2 inputs pemData []byte, password string. So I have converted my cert.pem from string to byte array and using privatekey.pem (copied the string code) as my password .
It gives me the error "no private key found" .
Please suggest what needs to be changed and provide an example.
The certificate must have a private key, as the private key is used for signing the assertion.
The service (the identity provider / AAD) has the public key, so it is able to verify the digital signature. See https://github.com/AzureAD/microsoft-authentication-library-for-go/blob/main/apps/tests/devapps/client_certificate_sample.go#L29
Thanks. I was confused and later realized I have to combine the public and private keys which will act as the pemData. This can be closed.
Documentation related to component
Please check all that apply
Description of the issue