| 
       SET-DB-CLIENT (  client-principal-handle  ? 
        , integer-expression logical-name alias ? ) | 
 If the LOGIN-STATE attribute on the client-principal object is set to "INITIAL", the function performs a user authentication operation, and if successful, sets user identity for the database connection,
If the LOGIN-STATE attribute on the client-principal object is set to "INITIAL", the function performs a user authentication operation, and if successful, sets user identity for the database connection,
   If the LOGIN-STATE attribute on the client-principal object is set to "LOGIN", the function performs a validation (SSO) of the user identity, and if successful, sets the user identity for the database connection.
If the LOGIN-STATE attribute on the client-principal object is set to "LOGIN", the function performs a validation (SSO) of the user identity, and if successful, sets the user identity for the database connection.
   If client-principal-handle is the Unknown value (?), the current connection identity remains unchanged, and the function removes the SECURITY-POLICY:SET-CLIENT( ) method lockout on the database connection.
If client-principal-handle is the Unknown value (?), the current connection identity remains unchanged, and the function removes the SECURITY-POLICY:SET-CLIENT( ) method lockout on the database connection.
   If the LOGIN-STATE attribute on the client-principal object is set to "INITIAL", the function performs a user authentication operation for the first OpenEdge database connection, and if the authentication is successful, the function:
If the LOGIN-STATE attribute on the client-principal object is set to "INITIAL", the function performs a user authentication operation for the first OpenEdge database connection, and if the authentication is successful, the function:
   If the LOGIN-STATE attribute on the client-principal object is set to "LOGIN", the function performs an SSO operation to validate and (if successful) set the user identity for each OpenEdge database connection in the ABL session.
If the LOGIN-STATE attribute on the client-principal object is set to "LOGIN", the function performs an SSO operation to validate and (if successful) set the user identity for each OpenEdge database connection in the ABL session.
   If client-principal-handle is the Unknown value (?), the current identity remains unchanged for all OpenEdge databases connections, and the function removes the SECURITY-POLICY:SET-CLIENT( ) method lockout on all the connections.
If client-principal-handle is the Unknown value (?), the current identity remains unchanged for all OpenEdge databases connections, and the function removes the SECURITY-POLICY:SET-CLIENT( ) method lockout on all the connections.
  | 
       /* Prompt user for userid and password and set the userid */
        DEFINE VARIABLE id AS CHARACTER FORMAT "x(255)" VIEW-AS FILL-IN SIZE 50 BY 1 LABEL "User id" NO-UNDO. DEFINE VARIABLE password AS CHARACTER FORMAT "x(255)" VIEW-AS FILL-IN SIZE 50 BY 1 LABEL "Password" NO-UNDO. DEFINE VARIABLE tries AS INTEGER NO-UNDO. DEFINE VARIABLE lFound AS LOGICAL NO-UNDO. DEFINE VARIABLE hCP AS HANDLE NO-UNDO. /* Note: No test for _User records, as in earlier releases: As of Release 11.0, OpenEdge can authenticate to other user account systems in addition to the _User table. */ CREATE CLIENT-PRINCIPAL hCP. /* create a CLIENT-PRINCIPAL only once during login*/ DO ON ENDKEY UNDO, RETURN: /* return if they hit endkey */ /* Reset id and password to blank in case of retry */ ASSIGN id = "" password = "". UPDATE SPACE(2) id SKIP password BLANK WITH CENTERED ROW 8 SIDE-LABELS ATTR-SPACE TITLE " Database " + LDBNAME("DICTDB") + " ". /* Use SET-DB-CLIENT instead of SETUSERID */ hCP:INITIALIZE(id,?,?,password). IF NOT SET-DB-CLIENT(hCP,"DICTDB") THEN DO: MESSAGE "Sorry, userid/password is incorrect.". IF tries > 1 THEN QUIT. /* Only allow 3 tries */ tries = tries + 1. UNDO, RETRY. END. END. DELETE OBJECT hCP. hCP = ?. HIDE ALL. | 
 For any errors while operating on database connections, SET-DB-CLIENT returns FALSE, records any errors in the ERROR-STATUS system handle, and leaves the current identity for a given database connection unchanged. Also, a validation failure when setting the identity for a database connection does not stop SET-DB-CLIENT from operating on other connected databases. It records an error message for that database and attempts the operation on the next one.
For any errors while operating on database connections, SET-DB-CLIENT returns FALSE, records any errors in the ERROR-STATUS system handle, and leaves the current identity for a given database connection unchanged. Also, a validation failure when setting the identity for a database connection does not stop SET-DB-CLIENT from operating on other connected databases. It records an error message for that database and attempts the operation on the next one.
   Within a transaction on a:
Within a transaction on a:
   Multi-tenant database — Any attempt to set an identity for the connection that changes the current database tenancy raises a run-time error.
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.
Non-multi-tenant database — As a best practice, Progress Software recommends that you not set a new identity for the connection.
   To assign a user identity while making a database connection, use the CONNECT statement.
To assign a user identity while making a database connection, use the CONNECT statement.
   This function also checks the value of the LOGIN-EXPIRATION-TIMESTAMP attribute on the client-principal object. If the timestamp has expired before the function can seal (during user authentication) or validate (during SSO) the object, the function sets the LOGIN-STATE attribute to "EXPIRED" and returns FALSE without changing the current connection identity.
This function also checks the value of the LOGIN-EXPIRATION-TIMESTAMP attribute on the client-principal object. If the timestamp has expired before the function can seal (during user authentication) or validate (during SSO) the object, the function sets the LOGIN-STATE attribute to "EXPIRED" and returns FALSE without changing the current connection identity.
   To set a connection identity through a user authentication operation:
To set a connection identity through a user authentication operation:
   The client-principal object must be unsealed (in the INITIAL state).
The client-principal object must be unsealed (in the INITIAL state).
   The required attributes must be properly set (see the SEAL( ) method and PRIMARY-PASSPHRASE attribute entries).
The required attributes must be properly set (see the SEAL( ) method and PRIMARY-PASSPHRASE attribute entries).
   The domain in the registry trusted by the database connection must be authentication-enabled. This can include a domain configured with a user-defined authentication system that has an ABL authentication plugin enabled. For information on OpenEdge support for domains and domain configuration, see OpenEdge Getting Started: Identity Management.
The domain in the registry trusted by the database connection must be authentication-enabled. This can include a domain configured with a user-defined authentication system that has an ABL authentication plugin enabled. For information on OpenEdge support for domains and domain configuration, see OpenEdge Getting Started: Identity Management.
   To set a connection identity through an SSO operation:
To set a connection identity through an SSO operation:
   The client-principal object must be sealed and set to the LOGIN state either explicitly by the application (using the SEAL( ) method) or implicitly by OpenEdge.
The client-principal object must be sealed and set to the LOGIN state either explicitly by the application (using the SEAL( ) method) or implicitly by OpenEdge.
   The object must be valid according to the domain registry used by the database connection: it must be sealed using the access code defined for a registry domain whose name matches the domain name stored in the object.
The object must be valid according to the domain registry used by the database connection: it must be sealed using the access code defined for a registry domain whose name matches the domain name stored in the object.
   The domain in the registry trusted by the database connection must be enabled and configured with an authentication system that supports SSO.
The domain in the registry trusted by the database connection must be enabled and configured with an authentication system that supports SSO.
   To set a connection identity when the authentication system is your ABL application, you must manually authenticate the user credentials for the client-principal object, explicitly call the SEAL( ) method to seal the object, and perform an SSO operation using this function to set the connection identity.
To set a connection identity when the authentication system is your ABL application, you must manually authenticate the user credentials for the client-principal object, explicitly call the SEAL( ) method to seal the object, and perform an SSO operation using this function to set the connection identity.
   For an STS-enabled database, this function always checks the user identity against the database’s own domain registry configuration.
For an STS-enabled database, this function always checks the user identity against the database’s own domain registry configuration.
   For databases not using STS, the domain registry this function uses to perform a user authentication or SSO operation depends on the database's own domain registry configuration. If it is configured to use the application domain registry, the function checks the user identity against the ABL session domain registry loaded using the SECURITY-POLICY:LOAD-DOMAINS( ) method. If it is configured not to use the application domain registry, the function checks the user identity against the database's own local domain registry that OpenEdge loads for the connection. For more information on domain and domain registry configuration, see OpenEdge Getting Started: Identity Management.
For databases not using STS, the domain registry this function uses to perform a user authentication or SSO operation depends on the database's own domain registry configuration. If it is configured to use the application domain registry, the function checks the user identity against the ABL session domain registry loaded using the SECURITY-POLICY:LOAD-DOMAINS( ) method. If it is configured not to use the application domain registry, the function checks the user identity against the database's own local domain registry that OpenEdge loads for the connection. For more information on domain and domain registry configuration, see OpenEdge Getting Started: Identity Management.
   After a user identity is set for a database connection, the AVM uses that identity to determine if the user has permission to access tables and fields in that particular database.
After a user identity is set for a database connection, the AVM uses that identity to determine if the user has permission to access tables and fields in that particular database.
   If you do not specify a database or pass the Unknown value (?), the user identity that this function sets for all connected databases overrides the user identity previously set by a call to the SET-CLIENT( ) method.
If you do not specify a database or pass the Unknown value (?), the user identity that this function sets for all connected databases overrides the user identity previously set by a call to the SET-CLIENT( ) method.
   Any database connection whose user identity is set using this function locks out the SET-CLIENT( ) method from setting an identity for that connection until you use this function to unlock it.
Any database connection whose user identity is set using this function locks out the SET-CLIENT( ) method from setting an identity for that connection until you use this function to unlock it.
   You can also use this function, instead of the SETUSERID function, to set the user identity for a database connection whether or not the user account is in the _User table.
You can also use this function, instead of the SETUSERID function, to set the user identity for a database connection whether or not the user account is in the _User table.
   Calling this method generates an audit event, and creates an audit record for the event in all connected audit-enabled databases according to each database's current audit policy settings.
Calling this method generates an audit event, and creates an audit record for the event in all connected audit-enabled databases according to each database's current audit policy settings.
   This function returns FALSE and with messages recorded in the ERROR-STATUS system handle when:
This function returns FALSE and with messages recorded in the ERROR-STATUS system handle when:
   A database connection is specified, the client-principal object is sealed, and SSO validation of its identity for the specified database connection fails.
A database connection is specified, the client-principal object is sealed, and SSO validation of its identity for the specified database connection fails.
   No database connection is specified, the client-principal object is sealed, and SSO validation of its identity for any connected database fails. In this case, ERROR-STATUS records a message for each database connection that fails SSO validation.
No database connection is specified, the client-principal object is sealed, and SSO validation of its identity for any connected database fails. In this case, ERROR-STATUS records a message for each database connection that fails SSO validation.
   The client-principal object is unsealed and the domain configuration is restricted to SSO operations.
The client-principal object is unsealed and the domain configuration is restricted to SSO operations.
   A database connection is specified, the client-principal object is unsealed, and user authentication of its asserted identity on the specified database connection fails.
A database connection is specified, the client-principal object is unsealed, and user authentication of its asserted identity on the specified database connection fails.
   The client-principal object is sealed and the domain configuration is restricted to user authentication operations.
The client-principal object is sealed and the domain configuration is restricted to user authentication operations.
   This function does not attempt set the connection identity for the foreign data source of a DataServer connection. However, it does attempt to set the connection identity for the OpenEdge schema holder database.
This function does not attempt set the connection identity for the foreign data source of a DataServer connection. However, it does attempt to set the connection identity for the OpenEdge schema holder database.