{"id":7330,"date":"2014-06-07T02:25:49","date_gmt":"2014-06-07T02:25:49","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/06\/07\/how-do-i-workaround-this-ssrs-authentication-exception-collection-of-common-programming-errors\/"},"modified":"2014-06-07T02:25:49","modified_gmt":"2014-06-07T02:25:49","slug":"how-do-i-workaround-this-ssrs-authentication-exception-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/06\/07\/how-do-i-workaround-this-ssrs-authentication-exception-collection-of-common-programming-errors\/","title":{"rendered":"How do I workaround this SSRS authentication exception?-Collection of common programming errors"},"content":{"rendered":"<p>I am trying to implement some custom security code into SSRS 2008 (not R2) to allow for Forms Authentication instead of Windows Authentication. I have based my solution on the Microsoft sample code and have managed to get most of it working absolutely fine. The only area where I&#8217;m having problems is when logging onto the actual Report Manager URL.<\/p>\n<p><strong>Issue 1<\/strong> When using the URL <code>http:\/\/localhost\/Reports_MSSQL2008\/<\/code> it doesn&#8217;t pick up the <code>UILogon.aspx<\/code> page that i&#8217;ve copied into the <code>\/Pages<\/code> folder (as instructed by the Microsoft example). I have amended the web.config in the ReportManager folder to contain the following:<\/p>\n<pre><code>\n  \n\n<\/code><\/pre>\n<p>I have tried changing the path to match exact path of the aspx file, but still no joy !!<\/p>\n<p><strong>Issue 2<\/strong> Because of the issue above, I tried just getting into UILogon and ReportManager via the URL, <code>http:\/\/localhost\/Reports_MSSQL2008\/Pages\/UILogon.aspx<\/code>. This works in that I get to step into my custom code (UILogon.aspx.cs and IAuthorisation \/ IAuthentication code) and I can see it doing the following:<\/p>\n<ul>\n<li>authenticating \/ authorising the user<\/li>\n<li>creating the cookie<\/li>\n<li>storing the cookie (sqlAuthCookie) on the response \/ request cookie container<\/li>\n<li>performing the response.redirect to the \/Folder.aspx page<\/li>\n<\/ul>\n<p>Problem is, when the response.redirect comes back into the GetUserInfo() method, the HttpContext.Current.User is null, and there is no cookie anymore. Because of this, a null IIdentity is returned (cant set it to anything else !!) and SSRS throws the error&#8230;<\/p>\n<blockquote>\n<p>Microsoft.ReportingServices.Diagnostics.Utilities.AuthenticationExtensionException:<br \/>\nThe Authentication Extension threw an unexpected exception or returned a value that is not valid: identity==null.<\/p>\n<\/blockquote>\n<p>For info &#8211; when I launch Report Builder \/ Visual Studio bi proj \/ the Web Service URL it does exactly what I require and works fine&#8230;&#8230;it&#8217;s just the Report Manager thats causing the problem.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am trying to implement some custom security code into SSRS 2008 (not R2) to allow for Forms Authentication instead of Windows Authentication. I have based my solution on the Microsoft sample code and have managed to get most of it working absolutely fine. The only area where I&#8217;m having problems is when logging onto [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7330","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7330"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7330\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}