windows-authentication

HTTP Error 404.15 - Not Found …because the query string is too long

扶醉桌前 提交于 2019-11-27 13:45:12
问题 I've checked lots of posts about this error but not been able to fix the problem yet. I have simple MVC5 website built in VS2013 running on Windows 8 pro. When the site was created the option for individual accounts was selected. I now need to enable windows authentication so that only AD account users can use the website and also authorisation so that I can limit access to certain views / controllers to particular AD groups. Having selected the web project within VS I have updated the

Get Active Directory User Information With Windows Authentication in MVC 4

守給你的承諾、 提交于 2019-11-27 12:12:58
I am working on an MVC 4 intranet application and am using Windows authentication. I would like to add to the user object that the authentication method uses (@User) and get that data from active directory (such as email, phone number, etc). I know I can create a custom Authorize attribute and add it to the controller that all of my other controllers inherit from, but I don't know if this is the right method to do what I want. My end goal is simple, I want @User object to have additional properties that are populated via Active Directory. Thanks for any help you can offer. I was just about to

Connecting to MS SQL Server with Windows Authentication using Python?

十年热恋 提交于 2019-11-27 11:39:56
How do I connect MS SQL Server using Windows Authentication, with the pyodbc library? I can connect via MS Access and SQL Server Management Studio, but cannot get a working connection ODBC string for Python. Here's what I've tried (also without 'Trusted_Connection=yes' ): pyodbc.connect('Trusted_Connection=yes', driver='{SQL Server}', server='[system_name]', database='[databasename]') pyodbc.connect('Trusted_Connection=yes', uid='me', driver='{SQL Server}', server='localhost', database='[databasename]') pyodbc.connect('Trusted_Connection=yes', driver='{SQL Server}', server='localhost', uid='me

Windows authentication doesn't works when I run project from Visual Studio

◇◆丶佛笑我妖孽 提交于 2019-11-27 11:18:07
问题 Windows authentication works good when I host my ASP.NET MVC project on IIS. But if I run it from Visual Studio - it doesn't. Here is my Web.config: <authentication mode="Windows" /> <authorization> <deny users="?" /> </authorization> Am I missing something? 回答1: If you are hosting in IIS Express (which you probably should), make sure you have enabled Windows Authentication in the properties of your Web Application. By the way if you create a new ASP.NET MVC 4 application in Visual Studio

ASP.NET MVC and Windows Authentication with custom roles

為{幸葍}努か 提交于 2019-11-27 11:15:49
I am trying to implement windows authentication in my ASP.NET MVC2 application. I've followed all the steps suggested by the official documentation: <authentication mode="Windows" /> <authorization> <deny users="?" /> </authorization> I've specified NTLM Authentication. So far so good. Everything works fine. I would like to check the users logged-in against my database. I would like to fetch roles from my table and then manage the authorization using a custom attribute. I don't want to use membership and roles provider. I'already have my tables Users/Roles in place cause they've been used for

How to get the current user's Active Directory details in C#

我的梦境 提交于 2019-11-27 10:41:22
I am working on an C# and ASP.Net application, that uses Windows Authentication. i.e. in Web.config: <system.web> <authentication mode="Windows" /> </system.web> I want to get details for the current user (full name, email address, etc) from Active Directory. I can get their pre Windows 2000 user login name (eg: SOMEDOMAIN\someuser ) by using string username = HttpContext.Current.Request.ServerVariables["AUTH_USER"]; I've worked out the LDAP query for the user, using their current login name (not their pre Windows 2000 user login name): DirectorySearcher adSearch = new DirectorySearcher( "

Unable to get windows authentication to work through local IIS

Deadly 提交于 2019-11-27 09:09:24
问题 So I've created a new ASP.NET MVC project using the intranet template. web.config contains the appropriate values (e.g. <authentication mode="windows"/> ). If I fire up the web app using the VS webserver, it all looks fine - the page shows my Windows domain and username and all. However, this works in Opera and Safari as well as IE and FF, which says to me it's not using Windows auth at all (since to the best of my knowledge this doesn't work in any browser except IE/FF). Next step is to get

Making a web request to a web page which requires windows authentication

一个人想着一个人 提交于 2019-11-27 08:34:05
I am trying to make a request to a web page using WebRequest class in .net. The url that I am trying to read requires Windows Authentication due to which I get an unauthorised exception. How can I pass a windows credentials to this request so that it can authenticate. HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create( "http://myapp/home.aspx" ); request.Method = "GET"; request.UseDefaultCredentials = false; request.PreAuthenticate = true; request.Credentials = new NetworkCredential( "username", "password", "domain" ); HttpWebResponse response = (HttpWebResponse)request.GetResponse

WCF Service, Windows Authentication

坚强是说给别人听的谎言 提交于 2019-11-27 08:24:28
问题 we wrote a WCF service, deployed on IIS. we chose Integrated Windows Authentication. service can not be used in this case but if we can set the authentication method of the IIS virtual directory to "Anonymous" for WCF services, then the error will go away. But "Anonymous" is not acceptable for our WCF service. We have to use Integrated Windows Authentication to authenticate the client. Any one knows how to fix this problem? Thanks in advance, Ashish 回答1: You have to do a few things: Uncheck

WebApi with OWIN SelfHost and Windows Authentication

十年热恋 提交于 2019-11-27 05:53:25
问题 I have a console application SERVER that hosts WebApi controllers using OWIN self-hosting, and runs under a custom account named "ServiceTest1". In the same machine I have another console application CLIENT that runs under the account "ServiceTest2", and I want to capture in SERVER that "ServiceTest2" invoked a controller action. However: WindowsIdentity.GetCurrent() is always "ServiceTest1". Thread.CurrentPrincipal is an unauthenticated GenericIdentity . RequestContext.Principal is null.