I faced a similar issue, and the steps below resolved it for me:
- Connect to your Microsoft Tenant via PowerShell using the command
Connect-MsolService
- Input the following command to retrieve the associated Service Principals:
Get-MsolServicePrincipalCredential -AppPrincipalId "Application ID of the Azure-Multifactor Auth Client"
- 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"
}
}
- You may need to rerun the AzureMfaNpsExtnConfigSetup.ps1 script to register the certificate.
I hope it helps :)