I've exhausted every bit of me to get Windows Authentication to work on the server and I cannot find any help on the internet. Windows authentication is working on my local PC, below is what I've done so far, kindly assist me understand if there's something I am missing or did wrong?
Windows Server 2012 R2 (v6.2) with IIS (v8.5.9600)
Here's how my web.config looks like:
<system.web>
<httpRuntime targetFramework="4.5" maxRequestLength="1048576" />
<compilation debug="true" targetFramework="4.5" />
<authentication mode="Windows"/>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
And here's the authentication section in IIS:
I've added the website as a Trusted Site (also as a Local Intranet) in Internet Explorer and that didn't help:
Many threads (including this one here) advised I add 2 entries to the registry to:
Set the DisableStrictNameChecking registry entry to 1
and add my website url in: BackConnectionHostNames
I've done so as per below and still no luck, I've even gone as far as performing the above steps on both the server and my local PC as well:
And I've mirrored everything else on there as is on my local PC. The server was restarted after doing the above 2 steps. The website is configured to use pass-through authentication in IIS and works fine on my local PC:
Is there something I am missing or not doing right? I've carried this problem into my New Year and I am so tired of it. Please anyone help me or point me in the right direction.
Related
IN my server IIS any Request take more than 3 min need to kill
Its lead a problem of server hanging due to high CPU Usage and RAM Memory
<system.web>
<globalization culture="en-US" uiCulture="en-IN" />
<compilation debug="false" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" executionTimeout="180" />
</system.web>
also included in
HttpContext.Server.ScriptTimeout = 60 * 3;
According to your description, if you want to set the connection for a request, I suggest you could try to set the IIS site's advanced setting connection timeout.
More details, you could refer to below steps:
Open IIS Manager, click on the site and go to Manage Web Site -> Advanced Settings.
Under Connection Limits option, you could modify the timeout value.
I created a brand new Asp.Net Core 2.0 web mvc application with windows authentication enabled.
If I immediately hit play it prompts me for user credentials which is not what I want. If I hit cancel it then redirects me to a 401.2 unauthorized error screen with the following error:
"You are not authorized to view this page due to invalid
authentication headers."
When I then stop the application and enable anonymous authentication on the project and hit play again, it runs the application successfully but will not display my username. #User.Identity.Name returns empty string.
How do I get around the security prompt while still being able to display my username?
In the .NET Framework, I would use this in the web.config file along with anonymous authentication = true and it would work the way I want:
<authentication mode="Windows" />
<authorization>
<deny users="?" />
</authorization>
I am using Visual Studio 15.4.1.
I think that the <authentication> tag is related to ASP.NET, and not IIS. In ASP.NET Core, the System.Web pipeline doesn't run.
I've had success in implementing Windows authentication with ASP.NET Core by using the following configuration in the web.config
<configuration>
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="false" />
<windowsAuthentication enabled="true" />
</authentication>
</security>
</system.webServer>
</configuration>
The <system.webServer> section is the one getting modified when you change the authentication settings through IIS Manager.
Edit after Ben's first comment
Sorry, I had misread part of your initial message, and thought that you were trying to deploy your application in IIS.
It looks like Windows Authentication is set up correctly since you get prompted for credentials. What I don't understand is why you get prompted. I'm using IE11, Edge and Chrome, and they all know how to send Windows credentials without prompting me.
What browser are you using when doing your test? Could you try with the ones I listed above?
I've developed a web application, I deployed this application on the server.
When I ran the application I am getting There was an unexpected server error, that is only error message it shows, no other details.
When I run this application using visual studio, it works just fine. I've tried with below <customErrors mode="On" />
Application pool has been kept in .net version 4.0
Asp.net has been registered with IIS.
Any ideas would help.
on server web.config try below config. you should see detailed error message.
<system.web>
<customErrors mode="Off" />
</system.web>
<system.webServer>
<httpErrors errorMode="Detailed"></httpErrors>
</system.webServer>
There was a network issue, which has been fixed, and it worked. Asp.net Impersonation has been "Enabled", Anonymous Authentication has been "Disabled". Enabled delegation [for kerberos] for the machine at the AD level. These made application work. There was no code issue at all as expected.
I am having an interesting issue with IIS 8. I can run the app just find. However after triggering a sql query I get the dreaded "Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'".
The real kicker to all of this is that when I run in IIS Express with Visual Studio 2013 it works fine.
IIS Authentication Settings
Web.Config:
<system.web>
<authentication mode="Windows" />
<identity impersonate="true" />
<authorization>
<deny users="?" />
</authorization>
</system.web>
Any/All help is appreciated!
Make sure the account that is running the app pool in IIS has access to SQL server. If that doesn't work then try changing the account that the app pool is running under to like NetworkService or LocalService and see if that has any effect.
Also try changing some of the other app pool settings in the "Advanced Settings..." dialog such as the managed pipeline mode and enable 32-bit applications.
Thanks everyone for the help.
What ended up happening is that we just used a local sql account.
We are going to use AD to control who has access to the page.
Using the <deny roles="DOMAIN\Domain Users"/>
option in web config file.
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.