Mvc 4 Forms Authentication with SQL Server database - sql-server

I have some controllers that create, edit, and show details in my ASP.NET MVC 4 project. I want to authorize users who are in a SQL Server table. The table of the users is in the same database with the other users that I'm manipulating using my controllers.
I googled it, watched "MVC Forms Authentication with custom database" tutorials. I couldn't find anything to walk me properly.
Could anyone please help?

I found the answer in here.This video shows you how to create MVC custom log in system: youtube.com/watch?v=asKYOwd2p2w

Related

How to Host my ASP .NET MVC Application with database?

I really need help or any kind of explanation about my problem.
I have a project built in Microsoft Visual Studio 2019. Its a ASP.NET MVC Application, and I have another project which enables me to create a database in my ("localDb")/ProjectsV13.
My approach was "Database-First", and created Model.espx automatically, and everything works fine (Used Entity Framework).
But now when I'm done making it, I need to PUBLISH It or HOST it. I don't understand the difference between that 2 terms.
I've been searching for solution for a quite a while, and still no solution.
I need to post in on CPanel.
How can someone use my app online?
How can someone see the same data as me?. Because I use localDb.
For example, I have login page for admin (just want someone to login with username:"Admin" and pw: "admin") and use my app.
I published it using FileSystem and managed to start my app with localhost. But that's not what I need
Thank you in advance!

Map asp.net core 2.0 Identity to existing DB schema

I have built a small web application with asp.net core 2.0 MVC. In this web application, I did not implement any authentication methods so far.
Right now I have an MSSQL database running in the background and I can add/view/edit/delete users from the database.
I adapted this tutorial and followed it pretty closely. However I also added some functionality like localization and stuff, and everything is running pretty smoothly.
My next goal is to enable authentication and authorization. The authentication part shall be straightforward. The goal is that the application will be running as an intranet solution. This means the authentication method just shall check if the Windows User is existing in the previously mentioned database. I don't want to create a separate login. However, it might be that there is a Windows user in the active directory, which is not part of the database. This User should just be able to see a default error page.
I made quite a huge research and I also tried a lot of different stuff, however, I do absolutely not find any "database first" tutorial for this part or any other documentation which explains what to do.
I actually "just" want to teach the asp.net core 2.0 identity framework that it shall look into my user-table and check if the current windows user is existent and if not to forward him to the error page.
A second step would be to load all the roles which this user is assigned to from the mapping table.
Any kind of help would be highly appreciated.
Dosc Microsoft has a lot of posts regarding authentication for ASP.NET Core. Here are some of the links to get you started:
ASP.NET Core Authentication
ASP.NET Core Authentication Identity
and a lot more.

how to I add a database to zurb foundation?

I'm trying to add a login portion on foundation and allow users to upload their own photos. how do I do that ?
if this is not the right place where to ask please redirect me
The foundation framework is simply a tool for you to develop the "front-end" of your website or app. A database would be a "back-end" feature that you would then create a form for (front-end) to connect users to your database (back-end).
You can develop the back-end yourself or use a CMS such as wordpress which will likely already have the features you need. Hope that helps.

Joomla! 2.5 use login data from another database

I have a hard question. I'd like the joomla login does not use its own database for users/password but I want to use my database users with my table fields, my passwords etc..
I don't know from where start, I thought I could edit database request for login to my db or create a little script to automatically add the users on joomla database.
I tried to see components/com_users/views/login/tmpl/default_login.php but it seems that there is nothing.
Can someone help me figure out what to change?
Maybe the simple thing is import my database users into database user joomla, is there any plugin or something else that you know?
p.s. I use Clarion theme build on Gantry framework, Joomla! 2.5.6 Stable, PHP 5.2.17
I would suggest that you find or create an authentication plugin that does this for you. Joomla can support multiple authentication systems.
Have a look at creating an Authentication Plugin for Joomla 1.5. The basic idea is described there.

How default ASP.NET MVC 3 project account controller work

I am new in MVC3. When i create a new default ASP.NET MVC 3 project template.
There is a AccountModels.cs and AccountController.cs C# class that handle data from a ASPNETDB.MDF DB file, there is a connection string (XML) in Web.config file, but i can't understand how it handle those data where is the Query or LINQ, How AccountModels.cs or AccountController.cs file know those DB tables Can anyone make me understand step by step? please someone help me please.
Sorry for my bad English.
It is using Microsoft Membership Provider.
From the doc:
ASP.NET membership gives you a built-in way to validate and store user
credentials. ASP.NET membership therefore helps you manage user
authentication in your Web sites. You can use ASP.NET membership with
ASP.NET forms authentication by using with the ASP.NET login controls
to create a complete system for authenticating users.
Basically it has quick straight forward configuration and creates a couple of tables in your database to keep user data.
It is flexible, but the interfaces are not very well segregated and if you need to extend it or plug your custom logic you may end up defining a tons of method throwing "Not Implemented" exception

Resources