I have an issue trying to add an idp to the authentication service.
My client is using forgerock login, and wants us to use SSO with SAML.
I have this working in an older project using Jitbit's simple SAML 2.0 component for ASP.NET https://github.com/jitbit/AspNetSaml/
But I am redesigning my application in .net core with identityserver4, and wanted to take advantage of the sustainsys implementation with the extra bells and whistles.
The type of SSO login is a simple redirect with ACS callback.
The information I have: SamlEndpoint - The URL to redirect to EntityId - My Entities Id AcsUrl - the URL to return to Certificate (string) (Taken from the metadata, which is not publicly available)
I have tried to do the following:
services.AddAuthentication()
.AddSaml2(Saml2Defaults.Scheme,
options =>
{
options.SPOptions.EntityId = new EntityId("{MyEntityId}");
options.SPOptions.ReturnUrl = new Uri($"ACS URL");
options.SPOptions.AuthenticateRequestSigningBehavior = Sustainsys.Saml2.Configuration.SigningBehavior.Never;
//options.SPOptions.ServiceCertificates.Add(new ServiceCertificate {
// Use = CertificateUse.Signing,
// Certificate = new X509Certificate2(bytes),
// Status = CertificateStatus.Current
//});
var idp =
new IdentityProvider(new EntityId("IDP ID"), options.SPOptions)
{
Binding = Sustainsys.Saml2.WebSso.Saml2BindingType.HttpRedirect,
LoadMetadata = false,
AllowUnsolicitedAuthnResponse = true,
SingleSignOnServiceUrl = new Uri("Redirect URL")
};
options.IdentityProviders.Add(idp);
});
The exception I am getting is: System.Configuration.ConfigurationErrorsException: 'Missing signing certificate configuration on Idp
But I cannot see how to add my certificate? as it has no private/public key:
From the metadata
<ds:X509Data>
<ds:X509Certificate>
MIIDYTCCAk..........7tOxUus=
</ds:X509Certificate>
</ds:X509Data>
Looking for a steer in the right direction as I am failing to work it out.
If I try and add the certificate (commented out above) then I get no private key provided exception.
Cheers guys