Quantcast
Channel: SQL Server Reporting Services
Viewing all articles
Browse latest Browse all 1418

How to add Custom Authentication in SSRS 2016 - Using ADFS & OWIN

$
0
0

I am working on adding custom authentication on top of SSRS 2016. There is a very good article available to do the same

Custom SecuritySample 2016 - https://github.com/Microsoft/Reporting-Services/tree/master/CustomSecuritySample2016

The steps Microsoft have provided to add custom authentication is basically adding forms authentication in which user name/password is taken as input on logon.aspx. I did this and it worked as expected. But my requirement is to authenticate user using ADFS (Active Directory Federation Services). And luckily there is another good article available to http://dotnetcurry.com/windows-azure/1166/aspnet-mvc-multiple-adfs-owin-katana

 Thanks to above article I was able to authenticate using ADFS and OWIN in sample MVC web Forms application.

But here is the problem, when I am trying to add the above sample login into Custom Security Sample provided by Microsoft(link above provided). I am getting an exception 

Exception of type 'System.Web.HttpUnhandledException' was thrown.No owin.Environment item was found in the context.

So here is what I am doing.

  1. I added Startup.cs file in CustomSecuritySample2016 solution provided https://github.com/Microsoft/Reporting-Services/tree/master/CustomSecuritySample2016 on GitHub.
  2. Then also added Startup.Auth.cs file under App_Start folder.
  3. Modified the web.config file to add following settings.
<addkey="owin:AppStartup"value="Microsoft.Samples.ReportingServices.CustomSecurity.Startup, Microsoft.Samples.ReportingServices.CustomSecurity"/><addkey="owin:AutomaticAppStartup"value="true"/>

4. Then on Page_Load event of Logon.aspx I am just trying to access the GetOwinContext method by extending HttpContext.

privatevoidPage_Load(object sender,System.EventArgs e)        {            var ct =HttpContext.Current.GetOwinContext();}

5. Rest of the changes are exactly the same as mentioned in custom security sample 2016 code on GitHub(Link above).

I already googled for this exception and I have already added this setting as per the right answers out there but mine is still giving this exception.

<addkey="owin:AppStartup"value="Microsoft.Samples.ReportingServices.CustomSecurity.Startup, Microsoft.Samples.ReportingServices.CustomSecurity"/><addkey="owin:AutomaticAppStartup"value="true"/>

Is is because SSRS don't allow to load any DLL that is not added in RSReportServer.config?

Note: I already posted this question on msdn community and they asked me to post here for any luck!!


Viewing all articles
Browse latest Browse all 1418

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>