Created
September 5, 2018 19:56
-
-
Save rbrayb/aae853ff6ad0c0d5ef1a808c6cba4182 to your computer and use it in GitHub Desktop.
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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")} | |
} | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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" | |
} | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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
https://medium.com/the-new-control-plane/connecting-two-instances-of-identityserver-4-using-the-componentspace-saml-v2-0-a21478a623ac