I cannot manage to get the Customer security sample provided from Microsoft to work. I have followed the README for CustomerSecuritySample here:
https://github.com/Microsoft/Reporting-Services/tree/master/CustomSecuritySample
Expected result
I expected that after a restart of the services a logon screen should be provided when entering http://computername/Reports in the browser. But instead I still get an Windows authentication prompt. I think that I miss some final steps in the guide that needs to be done to make it work but cannot figure out what
Setup
Instance name: SQL2016
URL set in Reporting Services Configuration Manager: http://computername/Reports
Configuration steps taken
The following changes have been made where I followed the README:
RSReportServer.config:
Set AuthenticationTypes to Custom:
<AuthenticationTypes>
<Custom/>
</AuthenticationTypes>
Replaced UI with new data:
<UI>
<CustomAuthenticationUI>
<loginUrl>/Pages/UILogon.aspx</loginUrl>
<UseSSL>False</UseSSL>
<PassThroughCookies>
<PassThroughCookie>sqlAuthCookie</PassThroughCookie>
</PassThroughCookies>
</CustomAuthenticationUI>
<ReportServerUrl>http://computername/Reports</ReportServerUrl>
<PageCountMode>Estimate</PageCountMode>
</UI>
Replaced Security extension information with:
<Extension Name="Forms"
Type="Microsoft.Samples.ReportingServices.CustomSecurity.Authorization, Microsoft.Samples.ReportingServices.CustomSecurity" >
<Configuration>
<AdminConfiguration>
<UserName>username</UserName>
</AdminConfiguration>
</Configuration>
</Extension>
Replaced Authentication extension with:
<Extension Name="Forms" Type="Microsoft.Samples.ReportingServices.CustomSecurity.AuthenticationExtension,Microsoft.Samples.ReportingServices.CustomSecurity" />
RSSrvPolicy.config:
Added a new code group:
<CodeGroup
class="UnionCodeGroup"
version="1"
Name="SecurityExtensionCodeGroup"
Description="Code group for the sample security extension"
PermissionSetName="FullTrust">
<IMembershipCondition
class="UrlMembershipCondition"
version="1"
Url="C:\Program Files\Microsoft SQL Server\MSRS13.SQL2016\Reporting Services\ReportServer\bin\Microsoft.Samples.ReportingServices.CustomSecurity.dll"/>
</CodeGroup>
Web.config:
Added under system.web:
<machineKey validationKey="GENERATED_VALIDATION_KEY" decryptionKey="GENERATED_DECRYPTION_KEY" validation="AES" decryption="AES" />
Changed authentication mode from Windows to Forms and added authorization and identity impersonation:
<authentication mode="Forms">
<forms loginUrl="logon.aspx" name="sqlAuthCookie" timeout="60" path="/"></forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
<identity impersonate="false" />
RSWebApp/Microsoft.ReportingServices.Portal.WebHost.exe.config:
Added the same validation and decryption key as in Web.config for Reporting services
<system.web>
<machineKey validationKey="GENERATED_VALIDATION_KEY" decryptionKey="GENERATED_DECRYPTION_KEY" validation="AES" decryption="AES" />
</system.web>
Copy files to right places
C:\Program Files\Microsoft SQL Server\MSRS13.SQL2016\Reporting Services\RSWebApp:
Copy Microsoft.ReportingServices.Portal.WebHost.exe.config
C:\Program Files\Microsoft SQL Server\MSRS13.SQL2016\Reporting Services\ReportServer:
1. Copy the other three config files mentioned above
2. Copy Login.aspx and .cs
3. Copy Microsoft.Samples.ReportingServices.CustomSecurity.dll into /bin
I'm running the preview version of SSRS with Power BI and the preview does not have support for multiple instances.
When I changed the files in C:\Program Files\Microsoft SQL Server Reporting Services\RSServer\ReportServer instead and then restarted "SQL Server Reporting Services - Standalone" I got the logon prompt
Reference: https://github.com/Microsoft/Reporting-Services/issues/21
I had to copy the MachineKey from Microsoft.ReportingServices.Portal.WebHost.exe.config file (RSWebApp directory) to the web.config file (ReportServer directory).
Related
I am trying to host WCF service in "hostgator". I want to set Trust level because I am getting security permission error.
When I set Trust Level in web.config, I am getting an error.
web.config:
<location allowOverride="true">
<system.web>
<compilation debug="true" targetFramework="4.5.2"/>
<identity impersonate="false" />
<authentication mode="None" />
<httpRuntime maxUrlLength="1024" relaxedUrlToFileSystemMapping="true"/>
<customErrors mode="Off"></customErrors>
<securityPolicy>
<trustLevel name="Full" policyFile="internal"/>
</securityPolicy>
</system.web>
</location>
Error:
An application error occurred on the server. The current custom error
settings for this application prevent the details of the application
error from being viewed remotely (for security reasons). It could,
however, be viewed by browsers running on the local server machine.
Can anybody suggest a way to solve this?
enter image description here
Per HostGator FAQ you must run in partial trust using their shared hosting:
No. The applications must be published in Medium Trust in order to run
on the Windows Shared Server.
You're not going to be able to use the SDK in a medium trust environment from what I've read. As Dynamics CRM 2016 expands its support for its REST API that may become an option for you.
I've got this error when I run my web app in my visual studio 2012. This happens after I've changed the web config to windows authentication mode.
These are the lines of codes I've changed from the original web config.
<httpRuntime targetFramework="4.5" />
<authentication mode="Windows" />
<identity impersonate="true" />
<roleManager enabled="true" defaultProvider="AspNetWindowsTokenRoleProvider">
<providers>
<clear />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
<authorization>
<deny users="?" />
</authorization>
Actually, when I deployed this project to the web server, it works perfectly fine. Now, my problem is that I could not debug this project using the visual studio 2012 cuz I have this error. I've tried opening other project and it works using the visual studio and mine is not but these two have same set-up.
Please try following:
Go to IIS Server, Click on Web site you created and look for Windows
Authentication, It should not be disabled
Check the folder were you kept you code and look try to give the full
permission to the current AD user.
Alternatively, you can try creating the .html page in you home directly and try
browsing the page.
In Visual Studio, in your project properties, you can choose which type of server you want. You must choose "IIS Server" and "Create virtual directory" to be in the same configuration as your deployment server and be able to set all needed parameters.
You'll certainly need to open IIS manually (outside of VS) to configure security settings on your development WebSite.
I have built an ASP.NET Web Service in C# and and I need to run this on Linux. After googling, I found out that it's possible to execute ASP.NET web service on Linux using Mono Develop. But when I try to open my Solution File in Mono (Xamarin Studio) it gives me an error:
Error while trying to load the project.
What am I doing wrong? Or maybe what is the best solution to run ASP.NET Web Service on Linux?
EDIT:
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation defaultLanguage="C#" debug="true">
<assemblies>
</assemblies>
</compilation>
<customErrors mode="RemoteOnly">
</customErrors>
<authentication mode="None">
</authentication>
<authorization>
<allow users="*" />
</authorization>
<httpHandlers>
</httpHandlers>
<trace enabled="false" localOnly="true" pageOutput="false" requestLimit="10" traceMode="SortByTime" />
<sessionState mode="InProc" cookieless="false" timeout="20" />
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
<pages>
</pages>
</system.web>
</configuration>
First of all, it can fail for a lot of reasons, so add a bug report into Xamarin's Bugzilla. But try initially to start Xamarin Studio, choose create new Asp.Net solution and then replace with your files in the .vcproj file (you can use a simple xml editor like gedit or Notepad++).
Depends on your application kind, I found that simple web pages/web services work but is not using IIS, but is using XSP4 (their custom C# written IIS-like web server) which sometimes is slow.
If you need simply to make some business logic to run fast on Mono and to not have configuration hassles, I would recommend to you .Net remoting. This is a low-overhead solution and I found it working even in combination with binary serialization.
I am trying to deploy an Microsoft ASP.NET application over to a hosting provider. I don't think I am able to configure the IIS server or anything like that.I have managed to upload my files to the server through FTP but I am facing the error:
"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections."
I am able to access the databases of the domain but I am not sure what configurations to use especially for my web.config. I am using an mdf file
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<add name="DBConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Details.mdf;Integrated Security=True;User Instance=True;" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.0">
</compilation>
<authentication mode="Forms">
<forms timeout="50"/>
</authentication>
<sessionState cookieless="true" regenerateExpiredSessionId="true" mode="InProc" timeout="60" />
<httpRuntime executionTimeout="180" requestValidationMode="2.0" requestPathInvalidCharacters="" maxRequestLength="1048576" />
</system.web>
</configuration>
It looks like your application is using SqlExpress to work with a local (to your project) database. Two things to look for - first, did the MDF absolutely make it to your deployed location? Sometimes things in App_Data are left behind during a publish. The other thing to check is whether the hosting provider to which you've deployed supports SQL Express and that the Data Source in your connection string is the proper way to utilize it on that platform.
Server Error in '/' Application.
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
I've looked through countless of previous questions and I haven't managed to get it working.
I've edited my web.config file and included a generated key at no success.
Web.config
<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<system.web>
<machineKey validationKey="E91A16E07A8D628F1F1397962336B0C63B6DC45B8EB3D16BBD5E5761DD8AE462C04C1CC215904FF0353E84EF8194B48682114C72CF8E10F5295E5ADF36DBC520" decryptionKey="EFA118DF00BFB8206F24A1BB4AF7D18FBD6A605B44789E9048D8127FFF950A09" validation="SHA1" decryption="AES" />
<httpRuntime />
<pages enableViewStateMac="true" />
<customErrors mode="Off" />
<compilation targetFramework="4.0" debug="true" />
<authorization>
<allow users="*" />
<deny users="?" />
</authorization>
</system.web>
</configuration>
This happens when I postback to another page!
Instead of using <form action="..."> to perform a cross-page post back, try changing your submit button to read <asp:Button runat="server" postbackurl="...">. Using the PostBackUrl property is the officially supported way to perform a cross-page post back, as it sets a flag in the request telling the destination page to ignore the __VIEWSTATE field.
The main problem lies in the Application Pool of your website.Configure your website to use the proper .NET Framework version (i.e. v4.0) under the General section of the Application Pool related to your website.
Under the Process Model, set the Identity value to Network Service.Close the dialog box and right-click your website and select Advanced Settings... from the Manage Website option of the content menu. In the dialog box, under General section, make sure you have selected the proper name of the Application Pool to be used.
Your website should now run without any problem.Hope this helps you overcome this error.