forms-authentication

Impersonate a membership user in ASP.NET

跟風遠走 提交于 2019-12-04 12:02:59
问题 In a generic asp.net website with Membership , Roles and hashed passwords enabled, I would like to provide the administrators with impersonation so that they may browse the website as that user would. The website should function as if that user is logged on and then be able to revert to their own login. What is the best approach to achieve this? An example use-case: A website with two types of users: 'Buyer' and 'Admin'. The website provides a 'Purchase' button to buy something specifically

Bypass Forms Authentication auto redirect to login, How to?

雨燕双飞 提交于 2019-12-04 12:01:35
问题 I'm writing an app using asp.net-mvc deploying to iis6. I'm using forms authentication. Usually when a user tries to access a resource without proper authorization I want them to be redirected to a login page. FormsAuth does this for me easy enough. Problem: Now I have an action being accessed by a console app. Whats the quickest way to have this action respond w/ status 401 instead of redirecting the request to the login page? I want the console app to be able to react to this 401 StatusCode

Set up STS but keep formsauthentication in webapp

回眸只為那壹抹淺笑 提交于 2019-12-04 10:48:20
I'm enabling an windows identity foundation on an existing webapp. I want to mess as little as possile with the existing code so I would like to the login page which uses formsauthentication left in the application and I just connect with the STS if the user enters the application via a specific page e.g "im_comming_from_some_other_site.aspx". in the "im_comming_from_some_other_site.aspx" the code would be like: Page_Load(...) { if(verifyAgainstSTS() { FormsAuthentication.SetAuthCookie(<some_STS_Userid), ...) Response.Redirect("default.aspx") } else { Response.Redirect("http://<STS_server_name

MVC session expiring but not authentication

会有一股神秘感。 提交于 2019-12-04 10:40:53
问题 I'm developing a C# MVC application and I can't seem to get the Authentication and Session timeouts to synchronize. I have a basic Forms Authentication setup and some limited session values. I set the Authentication timeout less than the session (28 minutes vs 30) but running against the development web server, the session will be wiped on a restart of the server but the authentication sticks around. I'm assuming that the authentication is being stored in a cookie that obviously survives the

Multiple websites, Single sign-on design [closed]

时光毁灭记忆、已成空白 提交于 2019-12-04 10:36:38
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year . I have a question. A client I have been doing some work recently has a range of websites with different login mechanisms. He is looking to slowly migrate to a single sign-on mechanism for his websites (all written in asp.net mvc ). I am looking at my options here, so here is a

How to allow mixed-mode authentication in IIS 7.0

谁说胖子不能爱 提交于 2019-12-04 08:37:38
How do you back-door authenticate Windows users into a website using forms authentication running on IIS 7.0? Create a separate page to handle windows logins. This page will authenticate the user and then set the Forms cookie for them. Then, add the page to the web.config to tell IIS 7 to use Windows authentication on that particular page. <configuration> ... <!-- this file captures the user and redirects to the login page --> <location path="Account/WindowsLogin.aspx"> <system.web> <authorization> <allow users="*" /> </authorization> </system.web> <system.webServer> <security> <authentication

ASP.NET MVC 3 Authentication/Authorization [closed]

折月煮酒 提交于 2019-12-04 08:26:40
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I am very new to ASP.NET MVC 3 (and MVC in general for that matter). In ASP.NET Web Forms, I did authentication using Principals and Identities. Is this the recommended way to do it in MVC or is there something newer? I see a Membership class, but if I understand it correctly it is too heavyweight for what I

ASP.net roles and Projects

﹥>﹥吖頭↗ 提交于 2019-12-04 08:16:12
EDIT - Rewrote my original question to give a bit more information Background info At my work I'm working on a ASP.Net web application for our customers. In our implementation we use technologies like Forms authentication with MembershipProviders and RoleProviders. All went well until I ran into some difficulties with configuring the roles, because the roles aren't system-wide, but related to the customer accounts and projects. I can't name our exact setup/formula, because I think our company wouldn't approve that... What's a customer / project? Our company provides management information for

App_Data/ASPNETDB.MDF to Sql Server 2005 (or 08)

我与影子孤独终老i 提交于 2019-12-04 07:43:36
I've been developing an ASP.NET WebForms app that needed account login functionality (e.g. register new users, change passwords, recover passwords, profiles, roles, etc). To do this, I used FormsAuthentication with the default data store, which, to my surprise, is an MDF file in App_Data. When it comes time to actually deploy this app. live on the web, I'm going to use some shared hosting like GoDaddy or another cheap company. For efficiency, I'd like to switch over from this MDF to actual SQL Server 2005 or 2008 (who in their right mind uses flat files?). With shared hosting, however, I'm not

What is a very simple authentication scheme for Sinatra/Rack

不羁岁月 提交于 2019-12-04 07:25:06
问题 I am busy porting a very small web app from ASP.NET MVC 2 to Ruby/Sinatra. In the MVC app, FormsAuthentication.SetAuthCookie was being used to set a persistent cookie when the users login was validated correctly against the database. I was wondering what the equivalent of Forms Authentication would be in Sinatra? All the authentication frameworks seem very bulky and not really what I'm looking for. 回答1: Here is a very simple authentication scheme for Sinatra. I’ll explain how it works below.