Steps to Implement SAML 2.0 in ASP.NET MVC Application


I wanted to implement SAML 2.0 authentication in my mvc application. The client has the ADFS set up with SAML and they provided the FederationMetadata.xml.
The client has asked to implement SAML 2.0 authentication from the MVC application, have been doing lot of research on the implementation and I have no idea of how to do it.

Please help me in detail steps of how to use component Space to implement SAML with ADFS. This is very urgent and need reply as soon as possible.
I have the web application ready but using the WsFederationAuthentication protocol. Also, i have installed the sample code fro your site but lost in all that, please need help.


Please take a look at our ADFS Relying Party Integration Guide.

This describes integration with ADFS.

Before doing that, if you haven’t already I suggest taking a look at our Examples Guide. This walks you through running the ExampleServiceProvider and ExampleIdentityProvider projects in Visual Studio. It’s a good idea to see SSO running in your environment.

The ExampleServiceProvider calls SAMLServiceProvider.InitiateSSO and SAMLServiceProvider.ReceiveSSO to support SAML SSO. Your application would have to make the same calls for SSO to ADFS.

It also includes a saml.config file that includes configuration information about your local service provider and the partner identity provider. Your application would need a similar saml.config but specific to your environment.

Thank you for your reply.
Yes, i have gone through the ADFS guide and the examples, but unable to run those examples throwing errors.

I would like to know step by step process of how to integrate the component space with my application.
I am lost and its confusing with lot of code, can you explain on an high level what needs to be done over all.

I need to implement SAML auth in my web application and ADFS should so the authorization and send me back the assertions. That’s it i don want anything else
Its been rough week to grab all these knowledge as i am new to SAML as well as ADFS.

Please help me…! Thanks in advance

The ExampleServiceProvider and ExampleIdentityProvider should run without any errors if you follow the instructions in the Examples Guide.
The ExampleServiceProvider, when run against ADFS, won’t work without updating its saml.config to use your ADFS server as it’s configured to use our test ADFS server which isn’t always running.

Did you take a look at the Quick Start Guide?
The “Creating a Service Provider” lists the steps required to setup your application as the service provider.

You might also be interested in our paid consulting services where we can offer assistance via web conference calls etc and help you update your application and SAML configuration, as well as assisting with the ADFS configuration.


Yes, Started looking at the examples guide and I dont have enough experience in generating the key and exporting local service metadata.
I need to find a solution as client is back of me, please help whatever is possible.

How do i contact the paid subscription for the support.


Please contact mentioning you’re interest in the paid consultancy and providing as much information as possible.


I have implemented the code based on the examples provided and below is the request built. But i am not getting any response please help me what is the mistake.

<samlp:AuthnRequest xmlns:samlp=“urn:oasis:names:tc:SAML:2.0:protocol”
Destination=“<a href=“””>
AssertionConsumerServiceURL=”<a href=“https://localhost:44363/Home/AssertionConsumerService”“>https://localhost:44363/Home/AssertionConsumerService
<saml:Issuer xmlns:saml=“urn:oasis:names:tc:SAML:2.0:assertion”></saml:Issuer>
<samlp:NameIDPolicy Format=“urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified”


Hi Sravani,
There’s most likely a configuration mismatch between your application and ADFS.
To determine the issue, I would need the following:

1. The ADFS SAML metadata XML document downloaded from the ADFS server.
2. The SAML log file for the service provider application.
3. A screenshot of what you see in the browser.
4. Screenshots of the relying party property tabs in ADFS so I can check the ADFS configuration.
5. If ADFS is displaying an error in the browser, the error events in the Windows event log on the ADFS server associated with the failed SSO.

I suggest sending this information to rather than posting it to the forum.