Skip to content
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

New-VB365EnterpriseApplication.ps1 error on ApplicationKeyCredential End Date #215

Open
sbeccato opened this issue Jan 3, 2024 · 0 comments

Comments

@sbeccato
Copy link

sbeccato commented Jan 3, 2024

Describe the bug
Got error executing the script.
The problem is during this call at line 93: New-AzureADApplicationKeyCredential
For some reason using this method "-EndDate $cert.GetExpirationDateString()" return the error described as if the EndDate retrieved were after the effective certificate end date.

I solved this issue using "$cert.NotAfter" instead "$cert.GetExpirationDateString()".
I modified also the start date, using "$cert.NotBefore".

Line 93 could be:
New-AzureADApplicationKeyCredential -ObjectId $app.ObjectId -CustomKeyIdentifier $base64Thumbprint -Type AsymmetricX509Cert -Usage Verify -Value $base64Value -StartDate $cert.NotBefore -EndDate $cert.NotAfter | Out-Null

To Reproduce
Steps to reproduce the behavior:

  1. Execute the script

Screenshots
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant