windows-authentication

How do I connect to SQL Server using OLEDB using Windows Authentication connection string

穿精又带淫゛_ 提交于 2019-12-02 02:07:39
问题 I have SQL Server 2010 running in windows auth mode and the proper groups have been assigned. I can connect via the SQL Server Client Studio using windows auth. That works. But when connecting using .NET OLEDB connections it fails and I can't figure out why. Here is the string: data source=172.20.0.113;initial catalog=ForgeEnterprise;Integrated Security=SSPI;multipleactiveresultsets=True;App=EntityFramework And here is the error: Login failed for user 'MOMENTUMI\jmcclure' Is there something I

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

不羁的心 提交于 2019-12-02 00:19:45
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 an form on a page, rather than the pop-up window asking for a username/password? May be you would like

Programmatically enable or disable anonymous authentication in IIS

China☆狼群 提交于 2019-12-01 21:47:14
I have a web application and I need to provide its users the option to switch login method from FormsAuth to WindowsAuth. I managed to change the web.config file via code: Configuration config = WebConfigurationManager.OpenWebConfiguration(Url.Content("~")); AuthenticationSection auth = ((AuthenticationSection)(config.SectionGroups["system.web"].Sections["authentication"])); auth.Mode = AuthenticationMode.Windows; // Or Forms if I want to. config.Save(); But the problem is, when I use FormsAuth, I need the Anonymouse Authentication option to be turned on, and when I use WinAuth, I need it to

Pass-through authentication not working. IIS 7

六眼飞鱼酱① 提交于 2019-12-01 18:50:12
On IIS 7 I set up an application called "XYZ", and an application pool for it. I set the identity of this application pool to a custom user, let's call it "Mario". Mario has NTFS access to the folder/files in which XYZ points to (remote share). In the XYZ authentication settings, only windows authentication is enabled: In the providers for windows authentication, only NTLM is active: Physical path credentials for XYZ are set to application user / pass-through: So the problem is, when I go to http://server.com/XYZ I get challenged (which is to be expected), but I does not matter what I put in,

Using windows authentication in asp.net with c#

本秂侑毒 提交于 2019-12-01 17:55:28
Im trying to understand how windows authentication works and how to implement it. Ive read quite a few articles and watched some quite length videos on youtube but i still cant my head around what needs to be added to my web.config file/ index.aspx page to make it work properly. Here is the index.aspx page: using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.SqlClient; using System.Configuration; using System.Data; namespace asset_management_system { public partial class index1 : System.Web

Windows authentication does not work

允我心安 提交于 2019-12-01 16:44:35
I am trying to setup Windows authentication in my .NET 4.0 MVC3 web application, so the intranet users in the company can log in without being prompted. In web.config I have: <authentication mode="Windows" /> <authorization> <deny users = "?" /> </authorization> In IIS I disabled anonymous access for the entire web application and left only Windows authentication checked. I am using IIS 6.0 on Windows 2003. Now, when I access the site from USER\COMPUTER I am logged in without being prompted, but as a wrong user (not myself, but the administrator account of the server that the web app is

CORS preflight request returning HTTP 401 with windows authentication

谁都会走 提交于 2019-12-01 15:48:19
I searched a lot on Google and Stack overflow to find a solution for my problem, but nothing worked. Here is my problem: I use IIS 7 with a special programming environment called WebDEV that does not allow direct manipulation of OPTIONS HTTP method. So, all solutions suggesting some kind of server-side request handling using code are not feasible. I have to use Window authentication and disable anonymous access I have a page that uses CORS to POST to this server. As this POST should have Content-type: Octet-stream , a preflight is issued by the browser. When I enable anonymous access,

Windows authentication does not work

微笑、不失礼 提交于 2019-12-01 15:47:14
问题 I am trying to setup Windows authentication in my .NET 4.0 MVC3 web application, so the intranet users in the company can log in without being prompted. In web.config I have: <authentication mode="Windows" /> <authorization> <deny users = "?" /> </authorization> In IIS I disabled anonymous access for the entire web application and left only Windows authentication checked. I am using IIS 6.0 on Windows 2003. Now, when I access the site from USER\COMPUTER I am logged in without being prompted,

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

别来无恙 提交于 2019-12-01 15:44:04
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 first I used Environment.Username . Which works well in development. But not after publishing. Because

CORS preflight request returning HTTP 401 with windows authentication

浪子不回头ぞ 提交于 2019-12-01 14:56:18
问题 I searched a lot on Google and Stack overflow to find a solution for my problem, but nothing worked. Here is my problem: I use IIS 7 with a special programming environment called WebDEV that does not allow direct manipulation of OPTIONS HTTP method. So, all solutions suggesting some kind of server-side request handling using code are not feasible. I have to use Window authentication and disable anonymous access I have a page that uses CORS to POST to this server. As this POST should have