This project is an Example for creating SAML 2.0 Service Provider (SP) using ComponentSpace library to connect to Identity Provider (Idp).
- Download ComponentSpace library for none-trial version (Included in the project a trial version for limited period)
- Identity Provider Certificate
- Service provider Certificate
First remove the existing ComponentSpace library
- In Solution Explorer, select the project.
- On the Project menu, choose Add Reference.
The Add References dialog box opens. - Click the tab for a category that contains references you want to remove.
- Select ComponentSpace reference, and click Select to place it in the Selected Components field.
- To remove the selected references, choose Remove.
Then add the new ComponentSpace library
- In Solution Explorer, right-click on the References or Dependencies node and choose Add Reference.
- You can also right-click on the project node and select Add > Reference.
- Click Browse then select ComponentSpace DLL file.
- In Solution Explorer, open Certificates folder, open idp.cer file
- Paste the Identity Provider Certificate inside
- In Windows Explorer, go to the project directory, open Certificate folder
- Replace sp.pfx with your Service Provider Certificate private key
- Make sure the file name still sp.pfx
- In Solution Explorer, open saml.config file
- Fill in the empty values with Service Provider and Identity Provider information
-
In Solution Explorer, open Web.config file
-
Fill in the empty value for PartnerIdP key with Identity Provider Entity ID
<add key="PartnerIdP" value="YOUR_IDP_ENTITY_ID" />
Send these information to your Identity Provider to be added into their configuration
- Base URL: "http://localhost:49864"
- Assertion Consumer Service endPoint: "/SAMLSP/AssertionConsumerService"
- SLO Service endPoint: "/loginSP"
- SP EntityID: "YOUR_SP_ENTITY_ID"
- SP certificate: "YOUR_SP_PUBLIC_KEY_CERTIFICATE"