public void Authenticate_CertificateNotFound() { var cookieStorage = new InMemoryEncryptedCookieStorage(); samlConfig.Saml2IdpCertificate = "not-found.cer"; var client = new SuomiFiIdentificationClient(samlConfig, new AuthStateAccessor(cookieStorage), new RsaShaCrypto(samlConfig, new CertificateStore(samlConfig))); client.Authenticate("https://localhost:39390", "fi", new RelayState <string>("register", null, "fi")); }
public SuomiFiIdentificationClientTests() { var cookieStorage = new InMemoryEncryptedCookieStorage(); samlConfig = new SamlConfig { Saml2SSOUrl = "https://testi.apro.tunnistus.fi/idp/profile/SAML2/Redirect/SSO", Saml2SLOUrl = "https://testi.apro.tunnistus.fi/idp/profile/SAML2/Redirect/SLO", Saml2IdpEntityId = "https://testi.apro.tunnistus.fi/idp1", Saml2EntityId = "https://localhost/SAML/2SP", Saml2Certificate = "localhost.pfx", Saml2IdpCertificate = "apro-test.cer", Saml2CertificateStoreLocation = StoreLocation.CurrentUser }; var store = new CertificateGeneratorStore(); client = new SuomiFiIdentificationClient(samlConfig, new AuthStateAccessor(cookieStorage), new RsaShaCrypto(samlConfig, store)); }