How i Can encrypt SAML response with SP certificate

0
Hi Team, Our SP provider ask to send SAML Response with encryption using SP certificate. Please let me know in the context of ComponentPro\UltimateSaml-Pro v7.0.226.13\Samples\Saml\Mvc\CS\Saml2-EasySamlApi\Saml2SsoDemoMvc\IdP void LoadSamlSettings() { Saml = new SamlManager(); #if LOADFROMJSON Saml.IdentityProvider.Config = SamlProvidersConfig.Load( AppDomain.CurrentDomain.BaseDirectory "saml-idp.json", false, false); #else LocalIdentityProviderConfig local = new LocalIdentityProviderConfig(); local.Name = LocalProviderName; local.Description = "IdpInitiated - IdP"; CertificateInfo certInfo = new CertificateInfo(); certInfo.CertificateFile = "IdpKey.pfx"; certInfo.CertificatePassword = "password"; local.LocalSignatureCertificates = new CertificateInfo[] { certInfo }; ProviderConfigCollection partnerConfigs = new ProviderConfigCollection(); PartnerServiceProviderConfig pcfg = new PartnerServiceProviderConfig(); pcfg.Name = PartnerProviderName; pcfg.Description = "IdpInitiated - SP"; pcfg.ExpectAuthnRequestSigned = true; pcfg.SignResponse = true; pcfg.SignAssertion = true; pcfg.EncryptAssertion = true; pcfg.AssertionConsumerServiceUrl = WebConfigurationManager.AppSettings["ConsumerServiceUrl"]; pcfg.SingleLogoutServiceUrl = WebConfigurationManager.AppSettings["LogoutServiceProviderUrl"]; CertificateInfo SpCertInfo = new CertificateInfo(); SpCertInfo .CertificateFile = "SP_Certificate.crt"; SpCertInfo .CertificatePassword = ""; pcfg.PartnerEncryptionCertificates = new CertificateInfo[] { SpCertInfo }; partnerConfigs.Add(pcfg); Saml.IdentityProvider.Config.Local = local; Saml.IdentityProvider.Config.Partners = partnerConfigs; #if SAVEJSON Saml.IdentityProvider.Config.Save(AppDomain.CurrentDomain.BaseDirectory "saml-idp.json"); #endif #endif } Above line of code is correct in LoadSamlSettings() function of Gloabl.asax file of IDP project Thanks Devendra Sahu
 
asked 6/25/2019 10:58:52 AM
add a comment

1 Answers

0
Yes that looks normal to us.
 
answered 6/27/2019 4:07:04 PM
add a comment

Your Answer

Not the answer you're looking for? Browse other questions tagged saml or ask your own question.