I'm somewhat new to ASP.NET MVC and I hoped you can help me with authentication for my app.
I have a MVC application that needs to be authenticated using SQL Server Log Ins. This means I have to create roles and users in SQL Server, and all security permissions are managed at Database level. Roles, users, and permissions aren't constant and we
should be able to manage them.
Any suggestion? Is there anyway to override default behaviors of Identity to achieve this goal? What do you think is the best way to implement this need?
As I know, if you use Role Management, it doesn't need store roles into database. Do you mean you want to authenticate users without database? If so, you could use Forms Authentication Credentials. For more information, please refer to the below link.
However, when you want to add new users, this way is hard to add. I suggest that you could use ASP.NET Identity with MVC. Please check the below article.
I hope I can explain it!:)
My MVC application have a database that stores all of the information. I want to have different users and roles and I need each user uses its own database logins. This way I can manage security permissions at database and table level. So I thought instead of
using Identity's default behavior and defining tables for users and roles I can use database commands to create database logins and roles. Like CREATE LOGIN user WITH PASSWORD = 'pass'. So the connection string for each user is unique and contains her username
and password
It seems I get something wrong and it's not the solution. Should I use Active Directory? Does it have the capabilities to manage each user and role separately
Also, is it possible to override Identity and achieve this goal?
As I know, it may not possible that each user uses its own database logins.
Akbari123
So I thought instead of using Identity's default behavior and defining tables for users and roles I can use database commands to create database logins and roles.
This situation also may not possible. I suggest that you could build different tables for different users, and different roles have different permission could access different tables.
We connect the database by the certain user and password, we set this information at the connection string. So, it is hard to achieve this. However, you could set different connection string with different databases for different users.
Best regards,
Archer
We are trying to better understand customer views on social support experience. Click HERE to participate the survey. Thanks!
None
0 Points
5 Posts
Authentication using Database Logins
Mar 27, 2015 10:53 PM|Akbari123|LINK
Hi,
I'm somewhat new to ASP.NET MVC and I hoped you can help me with authentication for my app.
I have a MVC application that needs to be authenticated using SQL Server Log Ins. This means I have to create roles and users in SQL Server, and all security permissions are managed at Database level. Roles, users, and permissions aren't constant and we should be able to manage them.
Any suggestion? Is there anyway to override default behaviors of Identity to achieve this goal? What do you think is the best way to implement this need?
Thanks in advance
Contributor
5642 Points
944 Posts
Microsoft
Re: Authentication using Database Logins
Mar 30, 2015 02:40 AM|Archer Wang|LINK
Hi Akbari123,
As I know, if you use Role Management, it doesn't need store roles into database. Do you mean you want to authenticate users without database? If so, you could use Forms Authentication Credentials. For more information, please refer to the below link.
https://msdn.microsoft.com/en-us/library/da0adyye.aspx
However, when you want to add new users, this way is hard to add. I suggest that you could use ASP.NET Identity with MVC. Please check the below article.
http://www.codeproject.com/Articles/790720/ASP-NET-Identity-Customizing-Users-and-Roles
Hope this could be helpful to you.
Best regards,
Archer
None
0 Points
5 Posts
Re: Authentication using Database Logins
Mar 31, 2015 04:01 AM|Akbari123|LINK
Hi Archer,
I hope I can explain it!:)
My MVC application have a database that stores all of the information. I want to have different users and roles and I need each user uses its own database logins. This way I can manage security permissions at database and table level. So I thought instead of using Identity's default behavior and defining tables for users and roles I can use database commands to create database logins and roles. Like CREATE LOGIN user WITH PASSWORD = 'pass'. So the connection string for each user is unique and contains her username and password
It seems I get something wrong and it's not the solution. Should I use Active Directory? Does it have the capabilities to manage each user and role separately
Also, is it possible to override Identity and achieve this goal?
Thanks for your replay,
Contributor
5642 Points
944 Posts
Microsoft
Re: Authentication using Database Logins
Apr 01, 2015 01:44 AM|Archer Wang|LINK
Hi Akbari123,
As I know, it may not possible that each user uses its own database logins.
This situation also may not possible. I suggest that you could build different tables for different users, and different roles have different permission could access different tables.
We connect the database by the certain user and password, we set this information at the connection string. So, it is hard to achieve this. However, you could set different connection string with different databases for different users.
Best regards,
Archer