I created a self-signed certificate and added it in power platform admin center using the following commands:
$certificateName = "powerpages.yourdomain.com"
$certPassword = ConvertTo-SecureString -String 'YourStrongPassword123!' -Force -AsPlainText
$certificate = New-SelfSignedCertificate `
-Type Custom `
-CertStoreLocation "Cert:\CurrentUser\My" `
-DnsName $certificateName `
-Subject "CN=$certificateName" `
-KeyLength 2048 `
-KeyAlgorithm RSA `
-HashAlgorithm SHA256 `
-NotAfter (Get-Date).AddYears(5) `
-KeyExportPolicy Exportable `
-KeySpec Signature
Export-PfxCertificate `
-Cert "Cert:\CurrentUser\My\$thumbprint" `
-FilePath "C:\certificates\powerpages.pfx" `
-Password $certPassword `
-CryptoAlgorithmOption TripleDES_SHA1
But the generated token from /_services/auth/token failed the signature verification from the public key at /_services/auth/publickey when I checked on jwt.io website.
I am not sure, what am I doing wrong.
I found this thread which says, self-signed certificated can be used to call an external API. https://community.powerplatform.com/forums/thread/details/?threadid=b28c273a-6550-4c9a-a603-39e59407fcb9
Let me know if anything else is required. I am happy to provide more info.
Any help would be appreciated. Thanks