windows-authentication

Getting the logged in username in ASP.NET MVC3 intranet application

懵懂的女人 提交于 2019-12-01 14:38:43
问题 I am working on a MVC 3 intranet application ( windows authentication ). The application must display the profile page of the user once a user logs in. In order to do that the username of the logged in user must be passed in as a route parameter in the following route in Global.asax.cs. routes.MapRoute( "Initial", "{controller}/{action}/{emailAlias}", // URL with parameters new { controller = "Home", action = "Home", userId = **<USERNAME>**} ); Here, for the I've used some alternatives. At

Log in to a windows network share (SMB) for this process only

假如想象 提交于 2019-12-01 14:31:56
It's easy to log into a Windows network share (SMB) for the whole user session (e.g. net use , WNetAddConnection2() etc). Is there any similar way that will only impact my current process? Some kind of token system, maybe? Whole session auth is okay if there's really no alternative, but I would rather avoid a "global solution to a local problem". Network sessions are handled by the windows kernel as part of the smb client driver, as such they are managed per windows workstation (not the user actually), meaning that you can't access the same share with two different credentials, and you can't

Log in to a windows network share (SMB) for this process only

此生再无相见时 提交于 2019-12-01 12:47:15
问题 It's easy to log into a Windows network share (SMB) for the whole user session (e.g. net use , WNetAddConnection2() etc). Is there any similar way that will only impact my current process? Some kind of token system, maybe? Whole session auth is okay if there's really no alternative, but I would rather avoid a "global solution to a local problem". 回答1: Network sessions are handled by the windows kernel as part of the smb client driver, as such they are managed per windows workstation (not the

Windows authentication in MVC

烈酒焚心 提交于 2019-12-01 06:52:39
I want to check the login name of a user using windows authentication. I have this as a constructor of my controller: public class HomeController : BaseController { public string UserIdentityName; public HomeController() { UserIdentityName = System.Web.HttpContext.Current.User.Identity.Name;// HttpContext.Current.User.Identity.Name; } } But UserIdentityName returns empty string... I also have this at my web.config: <authentication mode="Windows" /> any idea? Don't try to access any HttpContext related stuff in your controller's constructor. The earliest stage where you should be accessing it

runAllManagedModulesForAllRequests = “true” killing windows authentication in IIS7

只愿长相守 提交于 2019-12-01 06:43:47
We have windows authentication set up on our staging server for our clients to help prevent google from indexing our staging URLs. We recently found out that one of our sites is seemingly ignoring our IIS settings (anonymous authentication is disabled, windows authentication is enabled). We ended up figuring out that removing the setting runAllManagedModulesForAllRequests="true" on the modules node (which is required for our URL rewriting on the site) fixes the issue and the windows login/password box appears as expected when we browse to the site. If we keep the setting there, the site allows

Solution to avoid double-hop from client > web service > SQL Server

非 Y 不嫁゛ 提交于 2019-12-01 06:21:40
My project invoves a user connecting from client to web service, and then web service to SQL Server. The web services and SQL Server are on separate machines. Because of security requirements, we cannot used mixed mode in SQL Server, only Windows authentication. We are experiencing the "double-hop" issue between web service and SQL Server. We are using NTLM authentication and do not want to configure Kerberos because of the overhead and learning curve. We also don't want to have the web service and SQL Server on the same machine. From what I understand, all of our requirements make this

Windows authentication in MVC

烈酒焚心 提交于 2019-12-01 05:03:18
问题 I want to check the login name of a user using windows authentication. I have this as a constructor of my controller: public class HomeController : BaseController { public string UserIdentityName; public HomeController() { UserIdentityName = System.Web.HttpContext.Current.User.Identity.Name;// HttpContext.Current.User.Identity.Name; } } But UserIdentityName returns empty string... I also have this at my web.config: <authentication mode="Windows" /> any idea? 回答1: Don't try to access any

runAllManagedModulesForAllRequests = “true” killing windows authentication in IIS7

混江龙づ霸主 提交于 2019-12-01 04:55:25
问题 We have windows authentication set up on our staging server for our clients to help prevent google from indexing our staging URLs. We recently found out that one of our sites is seemingly ignoring our IIS settings (anonymous authentication is disabled, windows authentication is enabled). We ended up figuring out that removing the setting runAllManagedModulesForAllRequests="true" on the modules node (which is required for our URL rewriting on the site) fixes the issue and the windows login

SignalR not working with Windows-integrated authentication

坚强是说给别人听的谎言 提交于 2019-12-01 03:59:20
I have an ASP.NET MVC 4 app (.NET 4.5) and SIgnalR works fine with forms-based authentication (hosted via IIS/IIS Express) As soon as I change the app to windows-integrated authentication ( <authentication mode="Windows"/> in "web.config") it stops working. jquery.signalR-2.2.2.min.js:9 WebSocket connection to ws://localhost:51030/signalr/connect?transport=webSockets&blhablahblah failed: Error during WebSocket handshake: Unexpected response code: 403 After adding the [Authorize] attribute to my hub, the error changes to WebSocket connection to ws://localhost:51030/signalr/connect?transport

Login to Chrome Authentication window using AutoIT

我是研究僧i 提交于 2019-12-01 01:35:42
I tried login to firefox authentication window by following code : WinWaitActive("Authentication Required","","120") If WinExists("Authentication Required") Then Send("username{TAB}") Send("password{Enter}") EndIf But the same dint worked for chrome even though it has the same title as firefox. Any idea? @Milos @Samoth thanks for spending to solve my query. Using Autoit windows info tool, i could not identify the windows tile in chrome thats not a case in FF or IE. Instead of that "Autentication Required" identified as visible text. So modifying the code to WinWaitActive("","Authentication