Connecting Auth0 (IDP) and the ComponentSpace SAML v2.0 for .NET stack

Rory Braybrook
The new control plane
3 min readAug 6, 2018

This is a companion piece to the SP version.

I suggest you read that first as this post is a slimmed-down version to avoid repeating everything.

Auth0 will be the IDP and ComponentSpace will be the SP.

You need the ComponentSpace SAML stack .NET code with all the examples.

I will use the example code in this post. Normally, you would create your own project and reference the ComponentSpace dll.

The ComponentSpace SP example code is at:

… /SSO / HighLevelAPI / MVC / MVCExampleServiceProvider

in the .NET code.

(Note: “Auth0Tenant” below is the name of your Auth0 tenant).

I followed this Auth0 guide for adding a custom SAML IDP provider.

In the ComponentSpace web.config, add the “PartnerIDP” entry:

<! — The partner identity provider for SSO. →
<! — <add key=”PartnerIdP” value=”http://MvcExampleIdentityProvider"/>-->
<add key=”PartnerIdP” value=”urn:Auth0Tenant.au.auth0.com”/>

Create a new section in the saml.config:

<! — Auth0 example →
<PartnerIdentityProvider Name=”urn:Auth0Tenant.au.auth0.com”
Description=”Example Identity Provider”
SignAuthnRequest=”true”
SingleSignOnServiceUrl=”https://Auth0Tenant.au.auth0.com/samlp/RNgeLBwopbQmWBMcngd6lx1OPffRzS2p”
SingleLogoutServiceUrl="http://localhost:51801/SAML/SLOService.aspx"
PartnerCertificateFile=”Certificates\Auth0Tenant.cer”/>

The MVC Example Service Provider is configured to run at:

http://localhost:52901/

With these settings, we can then configure Auth0 by following the instructions in the link above.

I created a new application called ComponentSpaceApp.

Scroll down to the “Advanced Settings” link

Download the certificate — choose the .cer option.

Save it in:

…\SAMLSuite\SAML v2.0 for .NET\Examples\SSO\HighLevelAPI\MVC\MvcExampleServiceProvider\Certificates

Note: This ties up with the entry in the saml.config:

PartnerCertificateFile=”Certificates\Auth0Tenant.cer”/>

Clicking on the “Endpoints” tab under “SAML” shows the endpoint information:

Note: This ties up with the entry in the saml.config:

SingleSignOnServiceUrl=”https://Auth0Tenant.au.auth0.com/samlp/RNgeLBwopbQmWBMcngd6lx1OPffRzS2p”

In the “SAML2 Web App”, enter the callback URL:

Run the SP example application.

Click the link:

This brings up the Auth0 lock screen (the login screen).

The social providers at the top are because of the way I have configured Auth0. Ignore and login with the user name and password of one of your Auth0 users.

Success.

All good!

--

--

Rory Braybrook
The new control plane

NZ Microsoft Identity dude and MVP. Azure AD/B2C/ADFS/Auth0/identityserver. StackOverflow: https://bit.ly/2XU4yvJ Presentations: http://bit.ly/334ZPt5