asp.net-membership

How can I create users in a ASP.NET membership table without using CreateUser

非 Y 不嫁゛ 提交于 2019-12-09 05:27:42
问题 I want to migrate users and posts from an existing forum I am using to a ASP.NET membership table without using CreateUser. Basically I want to maintain userIDs so that when I migrate posts they continue to associate with the correct users. Is there a way to do this or would I be better off just using CreateUser and then finding a way to re-assign the post-by-UserIDs to the correct new IDs? Thanks 回答1: You could create a UserProfile table that you can use to join from the User table to your

ASP.NET Security Roles AND Permissions

给你一囗甜甜゛ 提交于 2019-12-08 23:58:45
问题 I'm comfortable with the ASP.NET security model whereby one can allow/deny access to users in the web.config based on what roles they are in e.g. <system.web> <authorization> <allow roles = "Admin" /> </authorization> </system.web> However what I want to do is give the admin user a set of permissions which can then be checked e.g. an Admin user with permissions like "can print documents", "can delete document" Is this sort of thing possible out of the box or would I need to go down a custom

Changing default connection string for Membership, Roles, etc

走远了吗. 提交于 2019-12-08 19:21:15
问题 By default, it seems like my web application is using LocalSqlServer as the connection string to use for any application services such as Membership/Roles/Authentication/etc. Is there any way I can change what the default connection string should be? It seems so arbitrary that the default is "LocalSqlServer" and the only way I was able to find this was by googling for this for about two hours. I don't want to be forced to have to name my server connection "LocalSqlServer" and I have no idea

Need ServiceConfiguration.cscfg to populate web.config sessionstate and connection strings

試著忘記壹切 提交于 2019-12-08 17:36:30
I need to propagate connection string changes for entity framework, asp.net membership (which are both in the connectionstrings section of web.config) and session state (which is in sessonstate's sqlconnectionstring) in web.config when I adjust these settings in windows azure's service configuration. During development we test our app as a standard asp.net webforms app, but once it is deployed it is running in azure. So we need to allow for the site running in both non-azure and an azure context. That's why we're just relying upon the values in web.config for now.Since these connection strings

When using ASP.Net Membership plus an additional table to store user Information, should I link other tables to aspnet_Users or my own Table?

走远了吗. 提交于 2019-12-08 17:00:47
问题 I'm using ASP.Net membership to secure my site and I have a question about how to store extra user information. By googling and reading other questions I think the 3 accepted approaches to storing additional data Profile framework - generally regarded as too restricting Custom Profile provider - a little bigger than I want to attempt at the moment Using another table with user information - the choice I'm following I've created a new table in addition to the ASP.Net membership tables named

Asp.net Membership-How to match security answer explicitly?

非 Y 不嫁゛ 提交于 2019-12-08 12:52:57
问题 I need to match security answer entered by user and security answer stored in aspnet_Membership table. I dont want to use resetpassword("Securityanswer") method to verify user. Is there any way to encrypt entered security answer or to decrypt stored security answer. Thanks. 回答1: / Convert entered sec ans to byte array / Dim bytes As Byte() = Encoding.Unicode.GetBytes(secAns) / This very importent to convert your key to base 64 string to get orginal hased password. / Dim src As Byte() =

Adding users to roles on registring failed ASP.NET MVC3

谁都会走 提交于 2019-12-08 12:43:27
问题 I like to enable users to choose their role on register in asp.net mvc web application. I have previous add roles via asp.net addministration tool. Here is the code I am using in register methods public ActionResult Register() { ViewData["roleName"] = new SelectList(Roles.GetAllRoles(), "roleName"); return View(); } [HttpPost] public ActionResult Register(RegisterModel model) { if (ModelState.IsValid) { // Attempt to register the user MembershipCreateStatus createStatus; Membership.CreateUser

Cross web domain login with .net membership

吃可爱长大的小学妹 提交于 2019-12-08 12:25:12
问题 I currently have three websites all running from the same DB example websites: www.mysite.com admin.mysite.com members.mysite.com now because this all runs from a single DB they all use the same .net Membership tables. All members are in a role: Member All Admins are in a role: Admin So the admins can log into the admin site and access all their admin functions etc, but the members if they tried to log into the admin area are bounced back to the login screen without any message, what I want

Cannot login with new password after resetting using SqlMembership Provider

瘦欲@ 提交于 2019-12-08 12:25:11
问题 After resetting the password using SqlMembership provider.I am unable to login with the new password. Below is the line of code used to reset the password for dbo.aspnet_Membership table. Password is encrypted . Everytime I reset the password a new encrypted value is stored inside the table. But unable to login. My webconfig setting: <membership defaultProvider="SqlProvider" userIsOnlineTimeWindow="15"> <providers> <clear /> <add name="SqlProvider" type="System.Web.Security

How to use both windows and forms auth with a single custom role provider

☆樱花仙子☆ 提交于 2019-12-08 12:18:21
问题 I have a custom role provider, built on a Role entity, and a many to many relationship called RoleUser, between my forms auth User entities and the Roles. I would like to switch this roles provider into using Windows auth as well now. It seems convenient for me piggy back of the forms Users, and create 'shadows' of AD users in my Users entities. Is this feasible or frowned upon, and are there any good papers etc. on this kind of setup? I'm using EF Code First against SQL 2005, and am not