asp.net-membership

Extending Windows Authentication in ASP.NET MVC 3 Application

一世执手 提交于 2019-12-20 08:29:50
问题 after a lot of googling and reading several solutions on how to manage mixed mode authentication in ASP.NET apps, I still have no fitting solution for my problem. I've got to implement an intranet application for a bunch of different user groups. Until now i've used windows authenthication which was very simple to implement. My problems arise when it comes to authorizing usergroups for special application functionalities. Using [Authorize(Users = "DOMAIN\\USER")] works great but due to that i

Using OpenID (via DotNetOpenAuth) along with user roles and other Membership Provider features

北城以北 提交于 2019-12-20 08:04:19
问题 I'm building an ASP.NET MVC site where I want to use DotNetOpenAuth to implement OpenID login (I'm completely dropping username/password-based login). So far, I've been writing my code for the default username/password system with the ASP.NET Membership Provider, utilizing the roles system, the profile system, and the basic registration system. Now, in my migration to OpenID, I'm foreseeing some issues, specifically with interfacing with membership controls provided by the ASP.NET Membership

Handling Login.Authenticate event

末鹿安然 提交于 2019-12-20 04:33:05
问题 A) Book I’m learning from says that if we handle Login.Authenticate event, then we have to authenticate users on our own. Thus control won’t automatically validate username and password. I thought book suggested this would only happen if we override Login.OnAuthenticate() method, but it appears that even if only add an event handler for Authenticate event, the automatic authentication doesn’t happen. But why is that? Why doesn’t event handling work like it does with Init or Load events, where

Handling Login.Authenticate event

北慕城南 提交于 2019-12-20 04:32:37
问题 A) Book I’m learning from says that if we handle Login.Authenticate event, then we have to authenticate users on our own. Thus control won’t automatically validate username and password. I thought book suggested this would only happen if we override Login.OnAuthenticate() method, but it appears that even if only add an event handler for Authenticate event, the automatic authentication doesn’t happen. But why is that? Why doesn’t event handling work like it does with Init or Load events, where

forcefully log out a specific user among all online users

有些话、适合烂在心里 提交于 2019-12-20 03:05:17
问题 In my site administrator can view list all other online users. Administrator can also disable any account from that list. Everything was going fine so far. But now I decided to log out the user which is being disabled. How can I do a log out operation for a particular user from the above specified online user list? NOTE: I'm using default membership schema for my SQL Server database. 回答1: You cannot logout a user from outside of their session. See Programatically logout an ASP.NET user for a

how to enable role in asp.net?

谁都会走 提交于 2019-12-20 02:13:38
问题 i am trying to enable roles in asp.net but,i am getting few errors and after trying my best i am not able to get them resolved. I am new to visual studio interface. I tried creating a login page as ASP.NET web application. Then as we have to configure the page to connect to the database to retrieve user details, i clicked on the ASP.NET configuration under Website control.. I was taken to the configuration page with three tabs.. Security was the tab that i was supposed to configure.. But i am

With ASP.NET membership, how can I show a 403?

南笙酒味 提交于 2019-12-19 10:32:33
问题 By default, ASP.NET's membership provider redirects to a loginUrl when a user is not authorized to access a protected page. Is there a way to display a custom 403 error page without redirecting the user? I'd like to avoid sending users to the login page and having the ReturnUrl query string in the address bar. I'm using MVC (and the Authorize attribute) if anyone has any MVC-specific advice. Thanks! 回答1: I ended up just creating a custom Authorize class that returns my Forbidden view. It

Get permission from Authorize Attribute?

安稳与你 提交于 2019-12-19 09:19:38
问题 I've implemented my own Authorize attribute, and I notice that it queries to check permissions when I use [Authorize] . Is there any way I can get that permission and use it in the current controller that applies the Authorize attribute without having to rewrite and requery the code in the controller? 回答1: Yes, you can. If you implemented your Authorize attribute as an ActionFilterAttribute you can use the ViewData collection to store information like this : public class

ASP.NET Membership Error

北战南征 提交于 2019-12-19 08:30:22
问题 I'm using ASP.NET MVC. I inserted ASP.NET membership tables into my database and i'm getting the error written below. Solution maybe? Thanks. The 'System.Web.Security.SqlMembershipProvider' requires a database schema compatible with schema version '1'. However, the current database schema is not compatible with this version. You may need to either install a compatible schema with aspnet_regsql.exe (available in the framework installation directory), or upgrade the provider to a newer version.

figuring out why asp.net authentication ticket is expiring

浪子不回头ぞ 提交于 2019-12-19 08:12:50
问题 I need help figuring out why my authentication ticket is expiring after about an hour on my hosted website. But if I run the site locally the authentication ticket stays alive for the correct amount of time. This is my localhost web.config: <authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="20160" slidingExpiration="true" path="/" /> </authentication> and this is my hosted web.config: <authentication mode="Forms"> <forms loginUrl="~/Account/LogOn" timeout="20160"