windows-identity

Username and password authentication for WIF (Windows Identity Foundation) in ASP.NET MVC

喜欢而已 提交于 2019-12-13 04:25:48
问题 We have two existing legacy web applications, one for the intranet using windows authentication within the domain, and one internet application, performing a custom web forms username + password based authentication. Now a new web applications is developed and will be available in the internet to both internet and intranet users, handling both authentication models. Therefore we decided to use WIF. We're going for ASP.NET 4.5 MVC 4 on Windows Server 2012. The intranet authentication shouldn't

Where Federation authentication token is saved [WIF STS]?

坚强是说给别人听的谎言 提交于 2019-12-11 01:49:07
问题 While i started to explore WIF, i have a doubt on the following: In the Windows Identification Foundation[WIF],looking on to Security Token Service[STS], i wish to know where the federation authentication token is being saved? I think its in browser cookie, if so can anyone please give me a insight about it? 回答1: I used the 'Fiddler' Web debugger to find the answer to this question. Here's what happens: Let's suppose that the name of your application is SecureApp and the name of your STS is

Impersonation on remote service says Login failed for user 'NT Authority\Anonymous Logon'

送分小仙女□ 提交于 2019-12-10 15:08:42
问题 I have a service that I want to when accessing databases I want to access databases to use the calling identities credentials. Before I access a particular database I do an impersonation by var winId = HttpContext.Current.User.Identity as WindowsIdentity; var ctx = winId.Impersonate(); //Access Database ctx.Undo(); This scenario works fine when the service runs locally on my PC. However when deployed on another remote PC I get the error: Login failed for user 'NT Authority\Anonymous Logon" as

How to impersonate another user?

蓝咒 提交于 2019-12-10 14:18:59
问题 I'm working on an ASP.net app and i'm trying to impersonate a user I'm creating a windowsIdentity with a token WindowsIdentity winId = new WindowsIdenty( token ); this token was got by calling the un managed code [DllImport("advapi32.dll")] public static extern int LogonUserA(String lpszUserName, String lpszDomain, String lpszPassword, int dwLogonType, int dwLogonProvider, ref IntPtr phToken); is there any other way to get a token without using this advapi32.dll unmanaged code? tks 回答1:

WindowsIdentity.Name doesn't return new name from Active Directory

断了今生、忘了曾经 提交于 2019-12-10 12:19:50
问题 Any help on this would be TRULY appreciated. I'll spare you the details, but we have to rename all of our Active Directory users from [First name] [Last Name] to [First Initial][Last Name] to get the space out of the usernames. We have a production web application that uses the following line of code to get the Username from Windows once the user logs in with Windows Authentication: System.Security.Principal.WindowsIdentity.GetCurrent().Name After we update a user's account through Active

asp.net WindowsImpersonationContext function

纵饮孤独 提交于 2019-12-10 10:22:01
问题 Can anyone please explain the function of the lines below: WindowsIdentity wId = (WindowsIdentity)HttpContext.Current.User.Identity; WindowsImpersonationContext wIdCon = wId.Impersonate(); That is used on a POST method with IIS basic authentication and works fine. If however the IIS authentication is set to windows the above no longer works. There is simply way too much code to dump for an example. 回答1: The call to Impersonate() makes IIS pretend to be the requesting user from that point on.

WIF- ID1014: The signature is not valid. The data may have been tampered with

偶尔善良 提交于 2019-12-09 05:33:05
问题 I've been using WIF to authenticate our new website, the STS is based upon the starter-sts implementation. To enable this to work correctly on out load balanced environment I've used the following in the global.asax to override the default certificate behaviour. void onServiceConfigurationCreated(object sender, ServiceConfigurationCreatedEventArgs e) { List<CookieTransform> sessionTransforms = new List<CookieTransform>(new CookieTransform[] { new DeflateCookieTransform(), new

Why do Thread.CurrentPrincipal.Identity and WindowsIdentity.GetCurrent() differ when impersonation is turned on?

自闭症网瘾萝莉.ら 提交于 2019-12-09 00:01:24
问题 I enabled impersonation and windows authentiaction. <authentication mode="Windows" /> <identity impersonate="true" userName="name" password="passord"/> But Thread.CurrentPrincipal.Identity.Name returnes the name of authenticated user and WindowsIdentity.GetCurrent() returns impersonated identity. Shouldn't these identities be the same? And under wich credentials does the code run in this case? 回答1: As far as I can understand the Thread.CurrentPrincipal contains the information of conditions

Windows Identity Foundation: How to get new security token in ASP.net

那年仲夏 提交于 2019-12-06 12:39:59
问题 I'm writing an ASP.net application that uses Windows Identity Foundation. My ASP.net application uses claims-based authentication with passive redirection to a security token service. This means that when a user accesses the application, they are automatically redirected to the Security Token Service where they receive a security token which identifies them to the application. In ASP.net, security tokens are stored as cookies. I want to have something the user can click on in my application

asp.net WindowsImpersonationContext function

戏子无情 提交于 2019-12-06 05:11:58
Can anyone please explain the function of the lines below: WindowsIdentity wId = (WindowsIdentity)HttpContext.Current.User.Identity; WindowsImpersonationContext wIdCon = wId.Impersonate(); That is used on a POST method with IIS basic authentication and works fine. If however the IIS authentication is set to windows the above no longer works. There is simply way too much code to dump for an example. The call to Impersonate() makes IIS pretend to be the requesting user from that point on. This is useful for a number of reasons, chiefly that the subsequent code will only work if the requesting