-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WARNING: An error occurred while attempting to retrieve or refresh access token. Error message: Could not use the certificate for signing #170
Comments
I've just solved the issue. Solution N°1 :
You also need to modify the Test-AccessToken script Solution N°2 : Hope it will help |
Jesus, this looks like an one ugly workaround :) I also encountered this same issue when using a self-signed cert on Powershell 5.1. Upon investigation I found this, you can find some ideas there: AzureAD/MSAL.PS#15 |
Thanks for the feedback! 😅 I agree, it's not the prettiest workaround, but it works in my context. |
Hello guys,
I'm using a corporate user certficate for connecting to graph :
$Cert = Get-ChildItem Cert:\CurrentUser\My | Where-Object { $_.Issuer.StartsWith("CN=Blabla") }
Connect-MSIntuneGraph -TenantId $TenantId -ClientId $AppId -ClientCert $Cert
However, I'm receiving the following error:
WARNING: An error occurred while attempting to retrieve or refresh access token. Error message: Could not use the certificate for signing. See inner exception for details. Possible cause: this may be a known issue with apps build against .NET Desktop 4.6 or lower. Either target a higher version of .NET
desktop - 4.6.1 and above, or use a different certificate type (non-CNG) or sign your own assertion as described at https://aka.ms/msal-net-signed-assertion.
I'm able to connect to my Service Principal ( app permissions ) with :
Connect-MgGraph -TenantId $TenantId -ClientId $AppId -Certificate $Cert
or using a ClientSecret
Connect-MSIntuneGraph -TenantID $TenantID -ClientID $ApplicationId -ClientSecret $SecuredPass
Connect-MgGraph -TenantId $TenantId -ClientSecretCredential $SecuredPass
For security reasons, our Security Officer prohibits the use of Client Secret. We are required to use only our company-issued user certificates..
While I have no issues connecting with Connect-MgGraph, I am unable to connect using Connect-MSIntuneGraph with the certificate.
How i can get a refresh token to pass through to the global variable AuthenticationHeader or how can i connect with the IntuneWin32App module ( Connect-MSIntuneGraph ).
Of course the usage for self sign certificat is also not allowed..
Thank you for your help
The text was updated successfully, but these errors were encountered: