windows-authentication

Get Active Directory User Information With Windows Authentication in MVC 4

自闭症网瘾萝莉.ら 提交于 2019-11-26 15:58:37
问题 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

Mixing Forms authentication with Windows authentication

房东的猫 提交于 2019-11-26 15:50:30
I have an (ASP.NET 3.5) intranet application which has been designed to use forms authentication (along with the default aspnet membership system). I also store additional information about users in another table which shares its primary key with the aspnet_users table. For users who are part of our domain I store their domain account name in the secondary users table, and I want to automatically log in users whose domain account name matches a name stored in the table. I have read the guides which are available - they're all from two years ago or more and assume that you are able to activate

Run Code as a different user

旧城冷巷雨未停 提交于 2019-11-26 14:33:30
Is there a way to tell my code to run as a different user? I am calling NetUserSetInfo via a PInvoke and I need to call it as a different user. Is there a way to do that? Richard Berg Impersonation requires calling some native APIs (namely, LogonUser) so it's probably not worth posting 3 pages of wrapper code. This page has a complete working sample: http://platinumdogs.wordpress.com/2008/10/30/net-c-impersonation-with-network-credentials/ Note that impersonation has important security considerations. Make sure you follow best practices. Milan Matějka Probably the best and the cleanest code

IIS7 folder permissions for web application

一世执手 提交于 2019-11-26 14:16:13
I am using windows authentication without impersonation on my company's intranet website with IIS7. Under IIS7, what account is used to access the folder which contains my web app using these settings? Would it be IIS_IUSRS? Or NETWORK SERVICE? Or another I don't know about? Thomas In IIS 7 (not IIS 7.5), sites access files and folders based on the account set on the application pool for the site. By default, in IIS7, this account is NETWORK SERVICE . Specify an Identity for an Application Pool (IIS 7) In IIS 7.5 (Windows 2008 R2 and Windows 7), the application pools run under the

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

纵然是瞬间 提交于 2019-11-26 14:11:44
问题 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

Receiving login prompt using integrated windows authentication

荒凉一梦 提交于 2019-11-26 14:07:48
I have a .NET 3.5 application running under IIS 7 on Windows 2003 server and cannot get integrated windows authentication working properly as I continue to get prompted for a login. I have set Windows Authentication to enabled in IIS with all other security types disabled and my application web.config file authentication/authorization is set up as: <system.web> <compilation debug="true" strict="false" explicit="true" targetFramework="3.5" /> <authenticationmode="Windows"/> <authorization> <deny users = "?" /> </authorization> </system.web> With this setup, I'm expecting behind the scene

401 response for CORS request in IIS with Windows Auth enabled

为君一笑 提交于 2019-11-26 13:02:25
I'm trying to enable CORS support in my WebAPI project, and if I enable Anonymous Authentication then everything works fine, but with Windows Auth + disabled anonymous authentication, the OPTIONS request sent always returns a 401 unauthorized response. The site requesting it is on the DOMAIN so should be able to make the call, is there any way to get around the issue without disabling Windows Authentication? You can allow only OPTIONS verb for anonymous users. <system.web> <authentication mode="Windows" /> <authorization> <allow verbs="OPTIONS" users="*"/> <deny users="?" /> </authorization> <

IIS7: Setup Integrated Windows Authentication like in IIS6

可紊 提交于 2019-11-26 10:41:11
问题 This is for IIS 7 on a Windows Server 2008 that is not part of an AD domain. I would like to password protect a website, where people have to enter a username/password (a windows account for example) to view the website. The website would then use its own authentication method (forms) to handle user accounts and decide whether or not to show member specific pages, etc. With IIS6, we just disabled anonymous access and enabled integrated windows authentication. IIS7 behaves differently and when

Impersonate using Forms Authentication

纵然是瞬间 提交于 2019-11-26 10:35:01
问题 I have an ASP.NET site that must use Forms Authentication and not Windows Authentication to access a ActiveDirectoryMembershipProvider . The site must use forms because they need a designed input form instead of the browser authentication popup that Windows authentication uses. The site needs to impersonate the user logged in via Active Directory to access user specific files. However, the WindowsIdentity.GetCurrent() is not the same as the HttpContext.Current.User.Identity although my web

ASP.NET MVC - Authenticate users against Active Directory, but require username and password to be inputted

房东的猫 提交于 2019-11-26 10:08:11
问题 I\'m developing a MVC3 application that will require a user to be authenticated against an AD. I know that there is the option in MVC3 to create an Intranet Application that automatically authenticates a user against an AD, but it uses Windows Authentication and automatically logs them on. This application may be accessed on \'Open\' workstations where the user will need to enter their Domain Username and Password. Any examples or online tutorial would be great. An example project would be