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

Demo service provider certificate appears to fail revocation check #70

Open
ronnieholm opened this issue Jun 26, 2023 · 3 comments
Open

Comments

@ronnieholm
Copy link
Contributor

Repro steps:

  1. Follow the steps in readme.md to setup IdentityProviderDemo and WebsiteDemo.
  2. Launch IdentityProviderDemo and WebsiteDemo from Visual Studio.
  3. Attempt to login on IdentityProviderDemo from WebsiteDemo.

Login fails to complete on the IdP side:

[Exception: Could not encrypt. No valid certificates found.]
   IdentityProviderDemo.SignonForm.CreateAssertionResponse(User user) in C:\Users\rh\source\repos\OIOSAML.Net\src\dk.nita.saml20\IdentityProviderDemo\SignonForm.aspx.cs:236
   IdentityProviderDemo.SignonForm.OnInit(EventArgs e) in C:\Users\rh\source\repos\OIOSAML.Net\src\dk.nita.saml20\IdentityProviderDemo\SignonForm.aspx.cs:74
   System.Web.UI.Control.InitRecursive(Control namingContainer) +454
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1714

due to

Validating chain with online revocation check failed for certificate 'A402BB172929AE0D0ADA62F6864329C35DC29483': System.IdentityModel.Tokens.SecurityTokenValidationException: The X.509 certificate SERIALNUMBER=CVR:34051178-FID:80719473 + CN=SP and WSC (Oiosaml-net.dk TEST) (funktionscertifikat), O=Digitaliseringsstyrelsen // CVR:34051178, C=DK chain building failed. The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.

The IdP cannot verify the service provider's certificate and thus cannot sign the response to the SP.

@ronnieholm
Copy link
Contributor Author

Problem is that setup_prerequisites.ps1 installs the root certificate in the wrong location.

TRUST2408 Systemtest VII Primary CA ends up in Intermediate Certification Authorities when it must be in Trusted Root Certification Authorities.

In Certificate Manager, clicking TRUST2408 Systemtest VII Primary CA, the UI reports:

This CA Root certificate is not trusted because it is not in the Trusted Root Certification Authorities store.

For now, to resolve the issue, drag and drop TRUST2408 Systemtest VII Primary CA into Trusted Root Certification Authorities.

@cemerson
Copy link

For now, to resolve the issue, drag and drop TRUST2408 Systemtest VII Primary CA into Trusted Root Certification Authorities.

This resolved the issue for me (I think) - though now I have a different error (below) which I think is unrelated. Anyhow - thanks for the certificate fix.

"The user doesn't have a session in context of a cookie ... which is required at this point in the pipeline. Plausible reason is that OIOSAML.Net is not running under https. The session cookie is marked with 'secure only'."

@ronnieholm
Copy link
Contributor Author

ronnieholm commented Jul 14, 2023

Yes. The user doesn't have a session in context of a cookie is unrelated. You may be running an out of date version of ASP.NET. One without the third-party cookie patch. This ASP.NET behavior changed 2-3 years ago, forced by Google, affecting not only NemLog-in.

Let's not mix issues.

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

2 participants