Previous Next

SETUSERID function
Authenticates a user identity for a specified database connection, verifying that the user ID and password supplied to the SETUSERID function match a user account in the _User table of the database. If they match, the database connection is set to the specified user identity and the function returns a TRUE value. If the database is multi-tenant, is also sets the user’s tenancy.
If the user ID is not in the _User table or the password is incorrect, SETUSERID returns a FALSE value and does not assign the user identity to the database connection. You can also check the ERROR-STATUS system handle for any messages returned.
Note:
Using this function overrides user identity previously set for the database connection by either the SECURITY-POLICY:SET-CLIENT( ) method or the SET-DB-CLIENT function.

This function authenticates user identities only against user accounts defined in the _User table of a connected OpenEdge RDBMS. To authenticate against additional OpenEdge-supported and application-defined authentication systems, use the SET-CLIENT( ) method or the SET-DB-CLIENT function, instead.
Syntax 
 
SETUSERID ( userid , password [ , logical-dbname ] )
userid
A literal value, field name, variable name, or expression that results in a character value that represents the user’s user ID. If you use a literal value, you must enclose it in quotation marks ("").
If the user is defined in a non-default domain, this value must be a fully qualified user ID, including both the non-qualified user ID and domain separated by a domain delimiter (@). If the user is defined in the default (blank) domain, only a non-qualified user ID (without a domain delimiter) must be specified. For more information on specifying a fully qualified user ID, see the reference entry for the QUALIFIED-USER-ID attribute.
Note:
password
A literal value, field name, variable name, or other character expression that results in a character value that represents the user’s password. If you use a literal value, you must enclose it in quotation marks ("").
Alternatively, you can encrypt the password using the ENCRYPT-AUDIT-MAC-KEY( ) method. For more information, see the documentation on encrypted passwords in OpenEdge Development: Programming Interfaces.
logical-dbname
The logical name of the database on whose connection you want to check and set the user identity. The logical database name must be a character string enclosed in quotes, or a character expression. If you do not specify this argument, the compiler inserts the name of the database that is connected when the procedure is compiled. If you omit this argument and more than one database is connected, ABL raises an error.
Notes 
*
*
Multi-tenant database — Any attempt to set an identity for the connection that changes the current database tenancy raises a run-time error.
*
Non-multi-tenant database — As a best practice, Progress Software recommends that you not set a new identity for the connection.
*
*
*
*
*
*
*
*
*
*
There is no _User record with the same user ID as the one supplied with the SETUSERID function.
*
*
*
*
The logical-dbname argument is omitted, and more than one database is currently connected.
*
When specifying the logical-dbname argument, you must provide the name of the logical database, not the physical database.
*
SETUSERID encodes the password argument and then compares the result with the value stored in the _User._password field of the _User table.
*
*
*
*
If the root user ID does not exist in the _User table, SETUSERID returns a value of FALSE when supplied with a userid of root. If the _User table does have a root entry, the user who assumes that user ID has all the privileges associated with the root user ID on UNIX.
*
You must create and enable a blank user ID ("") if you want to set the user ID to a null value.
*
See OpenEdge Getting Started: Identity Management, OpenEdge Development: Programming Interfaces, and OpenEdge Data Management: Database Administration for more information on user privileges.
*
Once an initial database connection is established, you can also use the SET-CLIENT( ) method (on the SECURITY-POLICY system handle) or the SET-DB-CLIENT function to set the user identity for the connection.
*
*
*
*
*
Multiple databases are connected and logical-dbname is not passed or resolves to the Unknown value (?)
*
Multiple databases are connected and logical-dbname does not refer to a connected database
*
See also 
Client-principal object handle, CONNECT statement, ENCRYPT-AUDIT-MAC-KEY( ) method, SET-CLIENT( ) method, SET-DB-CLIENT function, USERID function

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.