SQL Server Credentials

Source: Internet
Author: User
Tags to domain

Credentials contains the authentication information that is required to access resources other than SQL Server Instance, and how much Credentials contains a Windows user name and password.

If login is created in SQL Server authentication and the login is insinuate to credentials, the login is able to access resources outside of the SQL Server instance through the validation information stored in credentials. Credentials is an intermediary that accesses resources and is able to centrally manage access to resources by granting credentials access to resources. In SQL Server, you only need to insinuate the appropriate credentials for login (Windows login or SQL Server login) so that login has permission to access the appropriate resources.

1, creating the credentials syntax

The Identity specifies that the credentials contains the Account,secret specified password.

CREATEwithIDENTITY='identity_name'     []        []

IDENTITY ='identity_name'

Specifies the name of the used when connecting outside the server.

SECRET ='SECRET'

Specifies the secret required for outgoing authentication. This clause is optional.

Remarks

When IDENTITY was a Windows user, the secret can be the password. The secret is encrypted using the service master key. If The Service Master key is regenerated, the secret is re-encrypted using the new service master key.

After creating a credential, you can map it to a SQL Server login by using CREATE login or ALTER login. A SQL Server login can be mapped to only one credential, but a single credential can is mapped to multiple SQL Server Logi Ns.

If There is no login mapped credential for the provider, the credential mapped to SQL Server service account is used.

A login can has multiple credentials mapped to it as long as they is used with distinctive providers. There must is only one mapped credential per provider per login. The same credential can be mapped and other logins.

2, create credentials, and mapping to SQL Server Login

A SQL Server login can map to only one credentials, and multiple login can map to the same credentials.

CREATECredential Alterego with IDENTITY = 'Mary5', SECRET= '<EnterStrongPasswordHere>';/*Modify The login to assign a non cryptographic provider credential*/ ALTERLOGIN Login1 withCredential=Alterego;GO

The difference between 3,login and credentials

In SQL Server, login is used to log on to SQL Server Instance. Although login has permission to log on to SQL Server Instance, it does not have permission to access resources other than SQL Server Instance. While credentials is used to access resources other than SQL Server instance, mapping login to Credentials,login can access resources outside of SQL Server instance through the credentials stored domain account.

Appendix:

1, citing "Security Questions:logins, Credentials, and Proxies":

    • Login: A login is an any principal that's granted access to A SQL Server instance.  the Access can granted to domain users, domain group, or SQL Server authenticated accounts.
    • credential: A credential provides a mechanism to store login Information for a domain account within SQL Server.  the credential can then is used to pass the authentication information from into another login or a proxy to grant It permissions to resources external to SQL Server.

Credentials get brought in if permissions from domain users need to being granted to accounts or services that wouldn ' t USU  Ally has those permissions.  For instance, if an assembly required external_access, those permissions could is granted through the use of a credential. Credentials can also is used to grant SQL authentication accounts access to external resources.

2, citing the Credentials (Database Engine):

A credential is a record that contains the authentication information (credentials) required to connect to a resource outs IDE SQL Server. This information was used internally by SQL Server. Most credentials contain a Windows user name and password.

The information stored in a credential enables a user who have connected to SQL Server by-A-do SQL Server Authentication To access resources outside the server instance. When the external resource is windows, the user was authenticated as the Windows user specified in the credential. A single credential can is mapped to multiple SQL Server logins. However, a SQL Server login can mapped to only one credential.

System credentials is created automatically and is associated with specific endpoints. Names for system credentials start with a hash signs (# #).

Reference doc:

Credentials (Database Engine)

CREATE credential (Transact-SQL)

Security Questions:logins, Credentials, and Proxies

SQL Server Credentials

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.