Open topic with navigation
Specifies a login string for a Web server.
int web_set_user( const char *username, const char *password, const char *[realm\\]host:port );
int object.set_user( String username, String password, String host:port );
If no port is specified, the default port for the protocol is used (HTTP – 80, HTTPS – 443, FTP – 21). Specifying a port overrides the default for that protocol.
If an empty string ("") is passed, the username and password are applied to all domains unless a different user and password has been set for the domain with another web_set_user call.
To specify a realm, add it before the server name:
This function returns LR_PASS (0) on success, and LR_FAIL (1) on failure.
The following argument(s) can be parameterized using standard parameterization: username, password, host:port
The web_set_user function is a service function that specifies a login string and password for a Web server or proxy server. It can be called more than once if several proxy servers require authentication. web_set_user overrides the run–time proxy authentication settings for user name and password.
When you log onto a server that requires user and password validation, VuGen records a web_set_user statement containing the login details. However, there are some more stringent, authentication methods for which VuGen is unable to insert web_set_user statements. See User Authentication for more detail. In such cases, you can add web_set_user into your script manually.
If there is a specific authentication realm required, and VuGen either does not record it or records it together with other realms that are not required, you can use web_set_user to specify the realm. For example:
web_set_user("my_user", "my_password", "T1Realm\\myserver:29918");
When you run the script, the user authorization is automatically submitted along with every subsequent request to that server. At the end of the script, the authorization is reset.
Limitation: web_set_user has no effect if a proxy autoconfiguration file is specified in Run-Time Settings.
This function is supported for all Web scripts.