BUILD AUTHENTICATION BLOB Command

Description:

This command generates a character string containing user authentication data and loads it into a character variable. This variable may be used to supply a value to an "Authorization" HTTP request-header field in a GET, HEAD or POST command. This command is only valid within a script that has been defined as MODE HTTP.

This command allows scripts to support Basic, NTLM and Negotiate client authentication over HTTP. Negotiate client authentication applies to Windows 2000 clients only.

Basic authentication is the simplest "user:password" scheme, defined in RFC 2617. NTLM is Microsoft's NT Lan Manager, a security package available on all Windows platforms and used for authentication of Windows users.

The Negotiate security package appeared in Windows 2000 and allows a client and server to negotiate the actual authentication protocol. OpenSTA supports Negotiate authentication only when NTLM was selected as the underlying package.

A character string for use in Basic authentication, may be generated by specifying "FOR BASIC" and supplying a username, password and, optionally, a domain name.

A character string for use in NTLM authentication, may be generated by specifying "FOR NTLM" and user authorization data in one of three forms:

1. An explicit username, password and domain name.

2. Current user data.

3. A value returned in a "WWW-Authenticate" HTTP response-header field.

The value from a "WWW-Authenticate" HTTP response-header field may be obtained using the LOAD RESPONSE_INFO HEADER command, e.g.:

 LOAD RESPONSE_INFO HEADER ON 1 INTO blob1_var, WITH "WWW-Authenticate"

A character string for use with the Negotiate security package, may be generated by specifying "FOR NEGOTIATE" and user authorization data, as described above for NTLM authentication.

Format:

 BUILD AUTHENTICATION BLOB {&}
 	 FOR BASIC {&}
 	 FROM USER username PASSWORD password {DOMAIN domain} {&}
 	 INTO variable

or

 BUILD AUTHENTICATION BLOB {&}
 	 FOR [NTLM | NEGOTIATE] {&}
 	 FROM [CURRENT USER | {&}
 	        USER username PASSWORD password DOMAIN domain | {&}
 	        BLOB blob_variable] {&}
 	 INTO variable

Parameters:

username

A character variable, quoted character string or character expression, containing a username.

password

A character variable, quoted character string or character expression, containing a password.

domain

A character variable, quoted character string or character expression, containing a domain name.

blob_variable

A character variable containing the value returned in a "WWW-Authenticate" HTTP response-header field.

variable

A character variable into which the authentication value is loaded.

Examples:

 BUILD AUTHENTICATION BLOB FOR BASIC &
 	 FROM USER "Taylor" PASSWORD "Fred" &
 	 INTO authorization

 BUILD AUTHENTICATION BLOB FOR NTLM &
 	 FROM USER "Taylor" PASSWORD "Fred" DOMAIN "Munich" &
 	 INTO authorization
 BUILD AUTHENTICATION BLOB FOR NTLM &
 	 FROM CURRENT USER &
 	 INTO authorization

 BUILD AUTHENTICATION BLOB FOR NTLM &
 	 FROM BLOB authorize_scheme &
 	 INTO authorization

See also:

Input Stream Entry Commands