windows-authentication

Mono to SQL Server with Windows Auth

邮差的信 提交于 2020-01-02 01:17:07
问题 Quick... How to use Windows Authentication to SQL Server with the Mono SQL Client running on Windows without a username+ password in the connection string? More... We have to use Mono to support multiple platforms for some components of our app This is an external limitation that we can't change We will run the components that access the database only on Windows The portability/OS-agnostic features of the Mono SQL Client add no value That is, any component running on non-Windows will not

Identity Impersonation with ASP.NET 4 MVC not working as expected

徘徊边缘 提交于 2020-01-01 21:02:33
问题 I am in the process of building a Intranet MVC 4 application for our analysts. The goal is to allow internal users access to this application without having to sign on given they are part of our internal network. When they access the application I want to be able to capture their windows user name and check against the active directory using LDAP and retrieve the department they belong to and display the relevant details on the screen. Based on the advice from different fora, I have chosen

ASP.NET MVC Windows Authentiaction and DirectoryServices - Get Mail Address of the current user throws an InvalidCastException

 ̄綄美尐妖づ 提交于 2020-01-01 11:55:16
问题 I am using ASP.NET MVC 4 and Windows Authentication. When I am using VisualStudio everything works fine, but when I deploy my site an exception is thrown. var emailAddress = UserPrincipal.Current.EmailAddress; throws: Unable to cast object of type 'System.DirectoryServices.AccountManagement.GroupPrincipal' to type 'System.DirectoryServices.AccountManagement.UserPrincipal'. The rest works fine. Users can authenticate and I can get the users name etc. EDIT: I enabled Impersonation on IIS. Now I

Windows Authentication - Getting current user name

无人久伴 提交于 2020-01-01 09:39:09
问题 In my MVC application I want to render a table in a cshtml file, if the current log in user is some x person. I am using windows authentication and I have made the following changes in web.config file. <authentication mode="Windows"> </authentication> And in my controller when I am trying to access the current user name I am not getting any user name. I am trying the following: ViewBag.LogInUserName = Request.RequestContext.HttpContext.User.Identity.Name; This above line was working before.

IIS Windows Authentication before Anonymous

人盡茶涼 提交于 2020-01-01 08:52:17
问题 I have a website that I would like to allow both Forms and Windows Auth for. My problem is that it seems that when you setup IIS to allow both anonymous (Required for forms auth) and Windows auth that the browser won't send the user's network credentials. It just uses the anonymous login. Is there any way either in IE8 or IIS to have it try Windows Auth 1st and then fall back to Anonymous? Thanks for any help. 回答1: You can't ask for HTTP authentication (whether that's Basic Authentication or

IIS Windows Authentication before Anonymous

时光怂恿深爱的人放手 提交于 2020-01-01 08:50:10
问题 I have a website that I would like to allow both Forms and Windows Auth for. My problem is that it seems that when you setup IIS to allow both anonymous (Required for forms auth) and Windows auth that the browser won't send the user's network credentials. It just uses the anonymous login. Is there any way either in IE8 or IIS to have it try Windows Auth 1st and then fall back to Anonymous? Thanks for any help. 回答1: You can't ask for HTTP authentication (whether that's Basic Authentication or

How do I allow Windows Authentication in ASP.NET MVC4 application with multiple domains?

只谈情不闲聊 提交于 2019-12-31 03:36:09
问题 Two questions regarding Windows Auth in MVC4 application: How to I set it up so I can authenticate against two windows domains? What I am trying to do: [Authorize(Roles = @"DOMAINONE\Group Name")] public class HomeController : Controller { public ActionResult Index() { return View(); } ... } And the other domain: [Authorize(Roles = @"DOMAINTWO\Group Name")] public class StaffController : Controller { public ActionResult Index() { return View(); } ... } Is there a way to make to login screen

Android: NTLM Authentication, ksoap, and persistent connections

∥☆過路亽.° 提交于 2019-12-31 03:18:07
问题 After working with iOS and dealing with auth challenges without much of a learning curve, I've found that Windows Authentication is much more complicated of a process in Java/Android. I tried multiple different approaches, so without getting too much into those, I will get to the one that worked for the most part. I'm now using the class created for NTLM and ksoap called NtlmTransport I'm now successfully authenticating in the following way: NtlmTransport httpTransport = new NtlmTransport();

Suppress NTLM Authentication Dialog

回眸只為那壹抹淺笑 提交于 2019-12-30 07:32:35
问题 Code I have created a login page that combines Forms Authentication with Integrated Windows Authentication. public partial class Login : System.Web.UI.Page { // http://www.innovation.ch/personal/ronald/ntlm.html // http://curl.cofman.dk/rfc/ntlm.html // http://blogs.msdn.com/b/chiranth/archive/2013/09/21/ntlm-want-to-know-how-it-works.aspx protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.Headers["Authorization"].IsNullOrEmpty()) { Response.StatusCode = 401

Suppress NTLM Authentication Dialog

无人久伴 提交于 2019-12-30 07:31:46
问题 Code I have created a login page that combines Forms Authentication with Integrated Windows Authentication. public partial class Login : System.Web.UI.Page { // http://www.innovation.ch/personal/ronald/ntlm.html // http://curl.cofman.dk/rfc/ntlm.html // http://blogs.msdn.com/b/chiranth/archive/2013/09/21/ntlm-want-to-know-how-it-works.aspx protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.Headers["Authorization"].IsNullOrEmpty()) { Response.StatusCode = 401