User-1591181510 posted
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.
- I added Startup.cs file in CustomSecuritySample2016 solution provided https://github.com/Microsoft/Reporting-Services/tree/master/CustomSecuritySample2016 on GitHub.
- Then also added Startup.Auth.cs file under App_Start folder.
- Modified the web.config file to add following settings.
<add key="owin:AppStartup" value="Microsoft.Samples.ReportingServices.CustomSecurity.Startup, Microsoft.Samples.ReportingServices.CustomSecurity" />
<add key="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.
private void Page_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.
<add key="owin:AppStartup" value="Microsoft.Samples.ReportingServices.CustomSecurity.Startup, Microsoft.Samples.ReportingServices.CustomSecurity" />
<add key="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!!