liveBook · Manning

SQL login

As explained in Building Web APIs with ASP.NET Core

A database login is a SQL Server instance-level security principal that can authenticate to the server.

A SQL login is an instance-level security principal that authenticates to a SQL Server instance. An API can use its username and password in a connection string to access a database. section 4.2.4

Create the login in SQL Server’s main Security folder, not the Security folder beneath a database. Pair it with a database user to authorize access to a specific database. section 4.2.4

Configure access in two separate steps:

  • Add a login for authentication into the local SQL Server instance. section 4.2.4
  • Add a user inside the target database to authorize that login and control its database access. section 4.2.4
  • Use matching names for the login and user when following the MyBGList setup, then link them. section 4.2.4

MyBGList API access

Create a MyBGList login through the Login—New dialog, supplying its login name, authentication type, and password. Create the corresponding MyBGList database user afterward so the API can use the credentials in its connection string. section 4.2.4

Figure 4.6 Adding the MyBGList login in SSMS
04-06

Use the SSMS figure to identify the instance-level dialog for adding the MyBGList login. section 4.2.4

How Building Web APIs with ASP.NET Core covers it

How deep it goes
Explains instance-versus-database scope and creation workflow, but stops short of detailing permissions or password policy.
Examples
Uses the MyBGList database and matching MyBGList login and user configured through SQL Server Management Studio.
What it assumes
Assumes a created SQL Server database and access to the local instance through SQL Server Management Studio.
What you can do after
Operate/configure SQL Server access by creating an instance login and pairing it with a database user for API connectivity.
How it connects
Connects SQL Server authentication with connection strings, database users, and granular database access.

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.