$Web User: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
mNo edit summary
Line 5: Line 5:


==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>


<var>$Web_User</var> takes no arguments, and it returns a null indicating that the browser sent no userid, or it returns the userid sent by the browser.  
<var>$Web_User</var> 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 <var>$Web_User</var> 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 <var>$Web_User</var> is in a LOGONERR exception handler ([[JANUS WEB exception rules|"JANUS WEB exception rules"]]) 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.
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
%TIME = $Web_Date
%TIME = $Web_Date
   
   
IN FILE SECLOG STORE RECORD
IN FILE SECLOG STORE RECORD
RECTYPE = 'LOGONERR'
RECTYPE = 'LOGONERR'
TIME = %TIME
TIME = %TIME
USER = %BRUSER
USER = %BRUSER
IPADDR = %BRIPADDR
IPADDR = %BRIPADDR
END STORE
END STORE
</p>
</p>


Line 30: Line 30:
While <var>$Web_User</var> 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.  
While <var>$Web_User</var> 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]].
==See also==
<ul>
<li>[[$Web_Password]]</var>
</ul>


[[Category:Janus Web Server $functions|$Web_User]]
[[Category:Janus Web Server $functions|$Web_User]]

Revision as of 21:55, 26 October 2012

<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 ("JANUS WEB exception rules") 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