liveBook · Manning

Database user

As explained in Building Web APIs with ASP.NET Core

A database user is a database-level security principal that authorizes a login to access database objects.

A database user is a database-level security principal that authorizes a login to access objects in a specific database. A login authenticates to the SQL Server instance; a user authorizes access within MyBGList. This separation provides granular control over which databases each credential can access. section 4.2.4

Configure API access with two related security objects:

  • Add a login to authenticate against the local SQL Server instance. section 4.2.4
  • Add a user to authorize that login inside the MyBGList database. section 4.2.4

MyBGList API credentials

After creating the MyBGList database in SQL Server Management Studio, create credentials that the web API can place in its connection string. The login authenticates to SQL Server, while the MyBGList user grants database-specific access. section 4.2.4

Figure 4.7 Adding the MyBGList user and setting the role membership in SSMS
04-07

Use the SSMS view to inspect the MyBGList user and its role membership. section 4.2.4

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Distinguishes instance authentication from database authorization and explains their security scope.
Examples
Uses SSMS, the local SQL Server instance, and the MyBGList database as concrete configuration examples.
What it assumes
Assumes an installed SQL Server instance and a created database, while distinguishing login authentication from user authorization.
What you can do after
Operate/configure SQL Server credentials that authenticate an API login and authorize access to a selected database.
How it connects
Connects database users with logins, SQL Server instances, databases, connection strings, and role membership.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Building Web APIs with ASP.NET Core. The section links point to the parts of the book it draws on.