Federated Identity Issues when use self-signed certificate

Last week, we delivered a federated development workshop with Visual Studio 2015 and Active Directory. During the workshop exercises, we found that the self-signed certificate will make the Visual Studio project. One of our researcher, Sonny shows us the solution below.

Problem

You create a web application that use federated identity such as Active directory. However, during the development we faced an error because it used self-signed certification.

Cause

It might be because the compatibility issues on Visual Studio and Self-Signed Certification

Solution

  • Add this codes on Global.asax.cs (Source)

    ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

  • Web config error. (Source)

    for 4.5 and C#5 -

    type="Microsoft.CSharp.CSharpCodeProvider...

    for 4.6 and C#6 -

    type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"

blog comments powered by Disqus

Topics Highlights

About @ridife

This blog will be dedicated to integrate a knowledge between academic and industry need in the Software Engineering, DevOps, Cloud Computing and Microsoft 365 platform. Enjoy this blog and let's get in touch in any social media.

Xbox

Month List

Visitor