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 is the login name.
  2. pass is the password.
  3. scheme defines the method to be used during authentication.
  4. realm defines the realm.

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).