$Web User: Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 2: | Line 2: | ||
<span class="pageSubtitle"><section begin="desc" />User ID sent by browser<section end="desc" /></span> | <span class="pageSubtitle"><section begin="desc" />User ID sent by browser<section end="desc" /></span> | ||
$Web_User returns the userid that was sent by the browser in the HTTP user authentication header ("Authorization"), which could be different from the current ''Model 204'' userid. | |||
==Syntax== | ==Syntax== | ||
<p class="syntax"><section begin="syntax" /> %BRUSER = $Web_User | <p class="syntax"><section begin="syntax" /> %BRUSER = $Web_User | ||
<section end="syntax" /></p> | <section end="syntax" /></p> | ||
$Web_User takes no arguments, and it returns a null indicating that the browser sent no userid, or it returns the userid sent by the browser. | $Web_User takes no arguments, and it returns a null indicating that the browser sent no userid, or it returns the userid sent by the browser. | ||
Line 14: | Line 12: | ||
The most likely use for $Web_User is in a LOGONERR exception handler () or in NEWSESCMD processing. Since a LOGONERR exception handler runs under the WEBUSER userid, $USERID will not indicate the userid for which the login failed. Also, NEWSESCMD processing runs under the PRELOGINUSER userid, so, again, $USERID will not return the userid sent in the HTTP headers by the browser. | The most likely use for $Web_User is in a LOGONERR exception handler () or in NEWSESCMD processing. Since a LOGONERR exception handler runs under the WEBUSER userid, $USERID will not indicate the userid for which the login failed. Also, NEWSESCMD processing runs under the PRELOGINUSER userid, so, again, $USERID will not return the userid sent in the HTTP headers by the browser. | ||
The following example from a LOGONERR exception handler stores a record in a file for a failed logon attempt. | |||
<p class="code"> %BRUSER = $Web_User | <p class="code"> %BRUSER = $Web_User | ||
%BRIPADDR = $Web_IPAddr | %BRIPADDR = $Web_IPAddr | ||
Line 27: | Line 25: | ||
END STORE | END STORE | ||
</p> | </p> | ||
For non-public, that is, logon required URLs, $Web_User will equal $USERID if HTTP user authentication is used. But it might be null or even a different userid, if NEWSESCMD is used to do some other kind of user authentication, such as certificate-based authentication. For public URLs, $Web_User might be null or it might contain the last userid that the browser used to log on for the port. Since a browser does not know which URLs for a port are public or private, it will usually send a userid and password for every URL on a port after a successful login. | For non-public, that is, logon required URLs, $Web_User will equal $USERID if HTTP user authentication is used. But it might be null or even a different userid, if NEWSESCMD is used to do some other kind of user authentication, such as certificate-based authentication. For public URLs, $Web_User might be null or it might contain the last userid that the browser used to log on for the port. Since a browser does not know which URLs for a port are public or private, it will usually send a userid and password for every URL on a port after a successful login. |
Revision as of 15:53, 23 February 2011
<section begin="desc" />User ID sent by browser<section end="desc" />
$Web_User returns the userid that was sent by the browser in the HTTP user authentication header ("Authorization"), which could be different from the current Model 204 userid.
Syntax
<section begin="syntax" /> %BRUSER = $Web_User <section end="syntax" />
$Web_User takes no arguments, and it returns a null indicating that the browser sent no userid, or it returns the userid sent by the browser.
The most likely use for $Web_User is in a LOGONERR exception handler () or in NEWSESCMD processing. Since a LOGONERR exception handler runs under the WEBUSER userid, $USERID will not indicate the userid for which the login failed. Also, NEWSESCMD processing runs under the PRELOGINUSER userid, so, again, $USERID will not return the userid sent in the HTTP headers by the browser.
The following example from a LOGONERR exception handler stores a record in a file for a failed logon attempt.
%BRUSER = $Web_User %BRIPADDR = $Web_IPAddr %TIME = $Web_Date IN FILE SECLOG STORE RECORD RECTYPE = 'LOGONERR' TIME = %TIME USER = %BRUSER IPADDR = %BRIPADDR END STORE
For non-public, that is, logon required URLs, $Web_User will equal $USERID if HTTP user authentication is used. But it might be null or even a different userid, if NEWSESCMD is used to do some other kind of user authentication, such as certificate-based authentication. For public URLs, $Web_User might be null or it might contain the last userid that the browser used to log on for the port. Since a browser does not know which URLs for a port are public or private, it will usually send a userid and password for every URL on a port after a successful login.
While $Web_User can be used in any code, its most common use is likely to be in exception rules (), especially those associated with logon processing, such as LOGONERR and NEWPASSWORD rules, or in NEWSESCMD processing.
See also $Web_Password.