0

I have multiple Web applications using same database (MariaDB), so i want to using same user credentials as centralize, so:

  • Is it best practice to using same database users credentials and when add new user add the user also on the database with proper privilege ?? OR
  • create separate table for the users and the any transaction using only one database user to connect, insert, delete, update, .... Thanks & Regards.
1
  • 4
    There's no "best practice" -- your authentication and authorization mechanisms should be driven by your business and security requirements. If you explain what they are, someone might be able to suggest a concrete solution.
    – mustaccio
    Aug 28, 2020 at 15:17

1 Answer 1

2

It is certainly possible to use database usernames to authenticate web application users, but that is rather uncommon.

End users are typically authenticated at the enterprise level - meaning they use the same identity in a single-sign-on fashion to identify themselves with multiple enterprise applications.

Then in web applications, those identities are mapped to a small number of specific database users with capabilities matching the roles/profiles of the end users.

Having all enterprise users (and much less end users) defined in all databases becomes a logistic nightmare once the number exceeds a few ten's of users. It is definitely not possible once you start having end-users/customers accounts going rapidly into the millions.

Not the answer you're looking for? Browse other questions tagged or ask your own question.