simplemembership

Getting User Information using SimpleMembership

回眸只為那壹抹淺笑 提交于 2019-12-10 17:03:56
问题 Still trying to get to grips to the new SimpleMembership with MVC4. I changed the model to include Forename and Surname which works fine. I want to change the information displayed when logged in so instead of using User.Identity.Name in the View I want to do something like User.Identity.Forename, what's the best way to accomplish this? 回答1: Yon can leverage @Html.RenderAction() feature available in ASP.NET MVC to display this kind of info. _Layout.cshtml View @{Html.RenderAction("UserInfo",

How to use SimpleMemberShip Provider in Asp.net MVC 4 application [duplicate]

帅比萌擦擦* 提交于 2019-12-10 12:36:57
问题 This question already has answers here : Simple Membership Provider vs Universal vs Code-First (3 answers) Closed 6 years ago . Although i have been through this article http://blog.longle.net/2012/09/25/seeding-users-and-roles-with-mvc4-simplemembershipprovider-simpleroleprovider-ef5-codefirst-and-custom-user-properties/ but i dont know is it correct way to use simple membership provider in asp.net mvc4 application. Moreover, i want to know what is difference between DefaultMembership

MVC4 SimpleMemberhip Intranet webapp with Custom Roles

三世轮回 提交于 2019-12-10 12:14:21
问题 I am using SimpleMembership with WebMatrix. Since its an Intranet webapp, I am using the exisitng domain users in combination with custom roles and storing them in local webpages_ tables. I am trying to develop classes to manage the users & roles. Perhaps I am going about this the wrong way, but here is what I have and below where I am stuck. Setting this in global.asa WebSecurity.InitializeDatabaseConnection("SqlRoleManagerConnection", "webpages_Users", "UserID", "Username", false); Setting

How could I use my own database table for MVC 4 user control (and authorizing with boolean fields in role table)?

人盡茶涼 提交于 2019-12-10 12:06:53
问题 Hello guys I having been keeping searching for answers for a few days and read couple of posts already but still quite confused. I am using a user table with fields including First Name, Last Name, Email, Password, RoleID and other stuff like phone numbers etc. Also I have a "role table" which has a Field standing for "Role Name" in string and few other fields stands for different Accesses of Boolean type such as "AccessToAlterItemInformation" which if a user with such roles who having

ASP.NET MVC Remember me

谁说胖子不能爱 提交于 2019-12-10 10:27:30
问题 I've got a project based in ASP.NET MVC 4 that simple authentication. I'm trying to get my site to automatically log the user in when they check the remember me checkbox. However I'm having problems getting this working. After closing down the browser and reopening it the user is never logged in. After checking (http://forums.asp.net/t/1654606.aspx#4310292) I've added a machine key in, generated by IIS. I've set automatically generate at runtime and generate a unique key for each application

How to create simple membership sql tables manually?

吃可爱长大的小学妹 提交于 2019-12-09 17:17:24
问题 I'm looking for a tool similar to Aspnet_regsql.exe for ASP .NET Membership just for simpleMemberShip Provider. Creating the tables at runtime is too late, cause a client program uses the same tables. UserProfile webpages_Membership webpages_OAuthMembership webpages_Roles webpages_UsersInRoles Any advice would be great 回答1: You could just create the script yourself, using SQL Management Studio, after running your application on your developer machine: Example follows from a similar task I did

MVC 4 authentication with Active Directory or Membership database

血红的双手。 提交于 2019-12-09 11:52:42
问题 I´m building a web application which could get accessed in two ways. Everyone who is working in the same organisation as I can use our active directory to access the application. Everyone from outside should join the application through a separate membership database. Everyone should have a account in the membership database with his roles, so the ad connection is just a bonus to make it easier to keep the password and username in mind. I searched the internet but couldn't find a comparable

Error in UnitTest for WebSecurity.Login simple membership

房东的猫 提交于 2019-12-08 12:30:59
问题 I am writing a unit test for login process and have used simple membership api. from web project, login is working fine, but while in unit test. simple membership api is raising exception. API is throwing error on WebSecurity.Login method. System.NullReferenceException was caught HResult=-2147467261 Message=Object reference not set to an instance of an object. Source=System.Web StackTrace: at System.Web.Security.FormsAuthentication.SetAuthCookie(String userName, Boolean createPersistentCookie

Why does Membership.ValidateUser() always return false?

安稳与你 提交于 2019-12-08 10:56:28
问题 I have an ASP.NET 2010 app. When I go through the registraiton process, I correctly get logged in. However, if I just try to log in later, ValidateUser always returns false' blnSuccess = Membership.ValidateUser(strUserName, strPassword) I've stepped through to ensure the correct username & password are being sent in and that this person is in the db (Express). Here's my Web.Config....All just regular stuff. <connectionStrings> <add name="ApplicationServices" connectionString="data source=.

SimpleMembership MVC4 (existing database)

半世苍凉 提交于 2019-12-08 08:17:18
问题 At the moment I am working with a MVC4 application and a database. I want to use the default login and register procedure/ methods. I am using a table with user information like, firstname, surname, password, email... I just want to use my database with the default register/ login methods. On the internet I read several topics, but none of them give me a correct answer. This is what I have already did: 1 Use SimpleMembership So I added: <add key="enableSimpleMembership" value="true"> 2 Added