If I understand your question correctly, the mechanism you are describing is an authentication system.
Basically speaking, this kind of mechanism allows the identification of a certain party (e.g., a person or a machine process) that is attempting to access a particular system. Said party provides a certain set of credentials that are compared with information stored (or retrieved) by the authentication mechanism, and if such set of credentials matches the information stored (or retrieved) by the authentication tool, the involved party receives successful access to the system, otherwise access is denied.
Examples of authentication instruments are the ones created for web applications by means of:
If you are interested in authentication processes carried out by concrete database management systems, you might find of help:
Authentication systems are closely related to authorization components which, to put it short, take care of determining whether a specific party has permissions to perform a precise action within a given system.
A platform that assists in the development of both authentication and authorization elements pertaining to different types of application programs is: