Open patrikwm opened 3 years ago
Hi @patrikwm, thanks for reporting this. It looks like you are right, and the AdfsCertificate
resource doesn't work correctly. I'm happy to review a PR if you want to raise one to fix it?
Hi! I would love to do a PR, but I started using DSC about a week ago, so I have no experience in doing code changes in DSC modules at the moment.
When fixing this issue it would be good to have a state = present/absent or PurgeSecondaryCertificates = $True/$False because the current Primary certificate will become secondary certificate when specifying isPrimary on a secondary certificate.
This can be done with the Remove-AdfsCertificate
command.
Details of the scenario you tried and the problem that is occurring
Problem occurs when configuring fresh ADFS farm and trying to set 'token-signing' certificate with AdfsCertificate.
I get the error: PS0006: The IsPrimary parameter must be specified when a Token-Encryption or Token-Signing certificate is specified. But the real problem is that the certificate is not added in the first place.
Verbose logs showing the problem
Suggested solution to the issue
Add-AdfsCertificate before setting it.
Following command produces same error as in DSC.
Adding -IsPrimary to the command produces another error.
After adding the certificate as suggested in PS0010. It is possible to set the certificate to token-signing. So I think this is the part missing.
The only place In the code I can find the Add-AdfsCertificate is in AdfsDsc/Tests/Unit/Stubs/AdfsStub.psm1
The DSC configuration that is used to reproduce the issue (as detailed as possible)
The operating system the target node is running
Version and build of PowerShell the target node is running
Version of the DSC module that was used
1.1.0