I am working on my first ASP.Net MVC 4 app. I selected the Internet Application option and started with a LocaDB instance that had 4 tables in it (webpages_*).
I'm adding logging and error handling and I want to add ASP.Net Health Monitoring. To do that I had to run aspnet_regsql and now I have all of the aspnet_* tables along with the webpages_*.
What tables do I actually need for the Health Monitoring? Do I need all of them? Can I get rid of aspnet_Membership, for example.
I had tables for both Membership Provider and SimpleMembership Provider. Choosing one provider over the other allowed me to delete the cooresponding tables.
Related
Is it ok to delete records from ASP.NET identity tables AspNetUSers, AspNetRoles and AspNetUserRoles directly from SQL Server using T-SQL? The ASP.NET Core app is using only these three identity tables other AspNet... tables are empty.
UPDATE:
Why we want to do it directly through T-SQL since app has several users (with one role) and client wants to get rid of all the users quickly in one shot.
It is ok to delete rows from AspNetUsers, AspNetRoles or AspNetUserRoles.
Because IdentityServer does the same.
For example check the SQL statements which are generated when deleting a user through the UserStore class.
I have created a default ASP Net Core MVC web app with Individual User Accounts. I added a custom UserID INT field to the AspNetUsers table and linked this as a foreign key to all my other custom tables so I can track what users inserted/updated records in my database. I did this as I prefer using INT fields for primary keys. In this scenario everything is working fine.
I am now thinking of using an external identity provider such as Azure Active Directory however I cannot work out how I would link a user in Azure AD (or any other identity provider) to my local database tables to maintain the user id foreign key constraints. From all my research I cannot find any articles for this scenario.
How can I link user info from an external identity provider to my local database tables? I am worried that I might need to double handle the user account management in both the external identity provider and my local AspNet user tables to maintain the foreign keys with my other custom tables which seems crazy.
Perhaps i'm missing something obvious or my approach is all wrong so if there is a better alternative for tracking who did what in my database tables for an ASP Net Core web application using an external identity provider I would happily adopt it.
There is no need to additional steps to link the user info for the user from external identity provider. It should looks be same for the web app.
When the users login from external identity provider, it still require to register the users to bind the user with individual accounts. The only difference is that there is no password for this kind of individual account and it can match the record in the AspNetUserLogins. Here are two accounts, one is binding to the external identity provider and the other is not:
I have an ASP.NET MVC 5 web app. I have connected to a database on localDB ("MyWebAppDatabase"), which already contains many tables. I am accessing this using ADO.NET Entity Framework, and this is all working great.
However, I would like to add a table which references users who use the website: I have a "Subscription" table and would like to associate it with an ApplicationUser. The problem is that the tables containing user information are stored in a separate database (which was automatically generated by the Visual Studio when I created the project under the DefaultConnection context), and I don't know how I can perform this association.
What is the best way to go about this? I thought the ideal solution would be if I could move the tables that ASP.NET automatically created for application users into MyWebAppDatabase - then I can easily update the database with the correct tables and foreign keys. Is this correct? If so, how would I go about doing this? I'm not entirely sure where the database is for the application users (I couldn't decipher it from looking at Web.Config and reading the DefaultConnection connection string) and I don't really understand how I would be able to migrate the tables.
Thank you all for your help!
Ideally if you can move the tables into a single database you will get the best performance, otherwise you will have to do all of the JOIN's in memory in the application. You can't make foreign key references across database unfortunately.
If you point the connection string for the ASP.NET Identity to the same database that your Subscription table is located in and run the application and create some users it should create those tables automatically.
I am implementing Membership and security in my MVC4 website using custom database. Every things working fine but when I used .EDMX(Designer) to add my database tables membership and security starts giving errors. I also know the reason: This is due to duplicate Class files as default membership use code first approach and I am using database first approach. My question is there is any soluton that I can work using database first(EDMX) and also my security and membership functionality works fine.
Thanks.
The following post details the steps to take when using SimpleMembership with a Database-First approach: Using MVC 4 SimpleMembership with an existing database-first EF model
Also, you may find the following link has some useful information about SimpleMembership: http://weblogs.asp.net/jgalloway/archive/2012/08/29/simplemembership-membership-providers-universal-providers-and-the-new-asp-net-4-5-web-forms-and-asp-net-mvc-4-templates.aspx
Am I doing this right?
I have a client, they currently have a portal for their users, all their users are in an oracle database. They want to move to SharePoint 2010.
The user will log into the site via their username and password, which I will need to migrate from their existing database. The users also have account information, which I'll need to query FROM their existing database in Oracle (over a VPN tunnel from the web front end to their Oracle DB).
For the user authentication;
ASP.NET Membership -
I tried to configure my application to run under FBA. The aspnet_regsql.exe application created Users and Roles tables in my database (and a whole bunch of other ones). I need to add account_id, which is a foreign key to the client's database, and firstname, last name, which we'll store and need to surface on our application.
Where to I create the account_id and other fields that need to be associated to the user?
Is the ASPNET Profile table the same as the SharePoint Profile from the API? How do I populate this database to try?
Through IIS? Do I need to write a custom registration webpart, or can I somehow add custom columns to the profile and reprovision the ASP.NET user registration control in a visual webpart?
Thanks in advance for the help!
The ASPNet profile table is not the same as the SharePoint Profile. The SharePoint Profiles are assigned their own database thus much more robust where as theASPNET profile contains all of the propertynames/values for a single user in a single row, not really the best deal.
Your can use IIS to populate the users/roles, but you need to keep changing the Default Role and Membership providers. One way will let you add users and roles, but not let you log into SharePoint. The other vice versa. You can create the properties for the profile and assign them default values but I don't beleive you can set them on a user by user basis, I won't swear to that though. I found this tool on codeplex for FBA management but have not had time to test it yet.
I am also trying to figure out the FBA/user profile question. SharePoint is smart enough to create profiles for Windows accounts. I am hoping that once the providers for FBA are created it will pull the users name and basic info from the FBA provider and create SharePoint profiles as well so that I can use the UserProfileManager to access/store profile based information from the SharePoint profile database. It looks like you can configure the User Profile Service to sync with other sources, thats what I am going to investigate once I have some more free time.
try the new ASP.Net Identity System.
Introduction to ASP.NET Identity
and
Customizing User's Profile to add new fields in brand new database table here