Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Connecting two instances of IdentityServer 4 using the ComponentSpace SAML v2.0 for .NET Core and the Rock Solid Knowledge SAML v2.0 for .NET Core stack
// SAML client
new Client
{
ClientId = "https://IdentityServer4",
ClientName = "idsrv4 CS",
ProtocolType = IdentityServerConstants.ProtocolTypes.Saml2p,
AllowedScopes = {"openid", "profile"}
}
...
public static IEnumerable<ServiceProvider> GetServiceProviders()
{
return new[]
{
new ServiceProvider
{
EntityId = "https://IdentityServer4",
AssertionConsumerServices =
{new Service(SamlConstants.BindingTypes.HttpPost, "http://localhost:6000/SAML/AssertionConsumerService")},
SigningCertificates = {new X509Certificate2("sp.cer")}
}
};
}
"PartnerIdentityProviderConfigurations": [
{
"Description": "IdentityServer4-2",
"Name": "https://IdentityServer4-2",
"PartnerCertificates": [
{
"FileName": "certificates/idp.cer"
}
],
"SignAuthnRequest": true,
"SingleLogoutServiceUrl": "http://localhost:7000/SAML/SingleLogoutService",
"SingleSignOnServiceUrl": "http://localhost:7000/SAML/SingleSignOnService"
},
{
"Description": "IdentityServer4-RSK",
"Name": "http://localhost:5000",
"PartnerCertificates": [
{
"FileName": "certificates/idsrv3test.cer"
}
],
"SignAuthnRequest": true,
"SingleSignOnServiceUrl": "http://localhost:5000/saml/sso"
}
],
.AddSaml("idsrv4", "IdentityServer4", options =>
{
options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme;
options.SignOutScheme = IdentityServerConstants.SignoutScheme;
options.AssertionConsumerServicePath = "http://localhost:5000/saml/sso";
options.PartnerName = () => "http://localhost:5000";
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.