<PackageReference Include="System.Data.SqlClient" Version="4.7.0" />

SqlCredential

public sealed class SqlCredential
SqlCredential provides a more secure way to specify the password for a login attempt using SQL Server Authentication. SqlCredential is comprised of a user id and a password that will be used for SQL Server Authentication. The password in a SqlCredential object is of type SecureString. SqlCredential cannot be inherited. Windows Authentication (Integrated Security = true) remains the most secure way to log in to a SQL Server database.
public SecureString Password { get; }

Gets the password component of the SqlCredential object.

public string UserId { get; }

Gets the user ID component of the SqlCredential object.

public SqlCredential(string userId, SecureString password)

Creates an object of type SqlCredential.