Renewed Azure Multifactor Auth Client Certificate still showing expired in Enterprise Applications

Dvorak, David 70 Reputation points
2024-04-05T10:23:23.47+00:00

Yesterday, a certificate for VPN MFA expired.

As stated in the accepted answer in this question: https://learn.microsoft.com/en-us/answers/questions/195259/tenantid-certificate-for-vpn-mfa-expired-how-renew

And going through the documentation: https://learn.microsoft.com/en-us/entra/identity/authentication/howto-mfa-nps-extension-vpn#configure-certificates-for-use-with-the-nps-extension-by-using-a-powershell-script

We were successfull to generate a new certificate by executing the script.

Chechking if the script is correctly associated with the tenant:

Connect-MgGraph -Scopes 'Application.Read.All'
(Get-MgServicePrincipal -Filter "appid eq '981f26a1-7f43-403b-a875-f8b09b8cd720'" -Property "KeyCredentials").KeyCredentials | Format-List KeyId, DisplayName, StartDateTime, EndDateTime, @{Name = "Key"; Expression = {[System.Convert]::ToBase64String($_.Key)}}, @{Name = "Thumbprint"; Expression = {$Cert = New-object System.Security.Cryptography.X509Certificates.X509Certificate2; $Cert.Import([System.Text.Encoding]::UTF8.GetBytes([System.Convert]::ToBase64String($_.Key))); $Cert.Thumbprint}}

Was also successfull.

However, in our Azure Enterprise Applications, the certificate is still showing as expired:

User's image

My guess was, it just needed synchronizing but it didnt change. Did i miss a step or forgot something?

Thanks in advance for any help.

Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} vote

Accepted answer
  1. Matthieu308 91 Reputation points
    2024-04-16T12:50:41.2866667+00:00

    @Dvorak, David

    I faced a similar issue, and the steps below resolved it for me:

    1. Connect to your Microsoft Tenant via PowerShell using the command Connect-MsolService
    2. Input the following command to retrieve the associated Service Principals: Get-MsolServicePrincipalCredential -AppPrincipalId "Application ID of the Azure-Multifactor Auth Client"
    3. You'll receive a list containing all Service Principals and their corresponding credentials, including StartDate and EndDate. It's crucial to remove the expired ones. To do this, use the following code: $clientId = "Application ID of the Azure-Multifactor Auth Client" $keys = Get-MsolServicePrincipalCredential -AppPrincipalId $clientId -ReturnKeyValues $false $dtNow = [System.DateTime]::Now foreach($key in $keys) { if($key.EndDate -lt $dtNow) { Remove-MsolServicePrincipalCredential -KeyIds @($key.KeyId) -AppPrincipalId $clientId write-host $key.KeyId " - Expired - Deleted" } else { write-host $key.KeyId " - OK" } }
    4. You may need to rerun the AzureMfaNpsExtnConfigSetup.ps1 script to register the certificate.

    I hope it helps :)

    3 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

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.