com.HTTPRequest.setAuthentication

Defines the user login and password to authenticate to the server.

Syntax

setAuthentication(
   login STRING,
   pass STRING,
   scheme STRING,
   realm STRING )
  1. login defines the login to use for authentication.
  2. password specifies the password to use for authentication.
  3. scheme defines the method to be used during authentication. This is optional; it can be set to NULL.
  4. realm defines the realm. This is optional; it can be set to NULL.

Usage

The setAuthentication() method defines the mandatory user login and password to authenticate to the server.

The scheme parameter defines the method to be used during authentication. The supported values for the scheme parameter are Anonymous, Basic and Digest. The default is Anonymous.

An optional realm can be specified.

With Anonymous or Digest authentication, you must re-send the request if you get a 401 or 407 HTTP return code (authorization required)

If a user-defined authentication is set and there is an authenticate entry for this URL in the FGLPROFILE file, the user-defined authentication has priority.

In case of error, the method throws an exception and sets the STATUS variable. Depending on the error, a human-readable description of the problem is available in the SQLCA.SQLERRM register. See Error handling in GWS calls (STATUS).