$Web Realm: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:$Web_Realm}}
{{DISPLAYTITLE:$Web_Realm}}
<span class="pageSubtitle"><section begin="desc" />Set web "realm" for "Unauthorized" response<section end="desc" /></span>
<span class="pageSubtitle">Set web "realm" for "Unauthorized" response</span>


$Web_Realm allows the setting of the web "realm" before sending an "Unauthorized" response to the browser.
<var>$Web_Realm</var> allows the setting of the web "realm" before sending an "Unauthorized" response to the browser.


$Web_Realm is a callable $function (see [[Calling_Sirius_Mods_$functions|"Calling Sirius Mods $functions"]]), and it takes a single argument and returns a number.
<var>$Web_Realm</var> is a [[Calling Sirius Mods $functions|callable]] $function, and it takes a single argument and returns a number.


==Syntax==
==Syntax==
<p class="syntax"><section begin="syntax" /> %rc = $Web_Realm( realm_name )
<p class="syntax"><span class="term">%rc</span> = <span class="literal">$Web_Realm</span>(<span class="term"> realm_name</span> )
<section end="syntax" /></p>
</p>


===Syntax terms===
===Syntax terms===
Line 14: Line 14:
<tr><th>%rc</th>
<tr><th>%rc</th>
<td>A numeric variable to contain a return code.</td></tr>
<td>A numeric variable to contain a return code.</td></tr>
<tr><th>realm_name</th>
<tr><th>realm_name</th>
<td>Specifies the name of the realm to which a userid and password combination applies. This is a required parameter.
<td>Specifies the name of the realm to which a userid and password combination applies. This is a required parameter.
Line 19: Line 20:


==Usage notes==
==Usage notes==
Web realms can serve several purposes:
<ul>
<ul>
 
<li>Web realms can serve several purposes:
<ul>
<li>By having multiple realms for a single host, different URLs could be made available to different sets of users.  
<li>By having multiple realms for a single host, different URLs could be made available to different sets of users.  
<li>The realm could be used to send an arbitrary message to the browser to appear in a login pop-up window.  
<li>The realm could be used to send an arbitrary message to the browser to appear in a login pop-up window.  
Line 27: Line 28:
</ul>
</ul>


 
<li>The realm sent by <var>$Web_Realm</var> is not sent to a browser unless a status of 401 ("Unauthorized") is sent to the browser.
The realm sent by $Web_Realm is not sent to a browser unless a status of 401 ("Unauthorized") is sent to the browser.
This means that a <var>$Web_Realm</var> call is meaningless unless followed by a <var>$Web_Done</var> with a status code of 401, for example:
This means that a $Web_Realm call is meaningless unless followed by a <var>$Web_Done</var> with a status code of 401, for example:
<p class="code">%rc = $Web_Realm('Toxico Database Systems')
<p class="code"> %RC = $Web_Realm('Toxico Database Systems')
%rc = $Web_Done(401, 'Unauthorized')
%RC = $Web_Done(401, 'Unauthorized')
</p>
</p>


<li>If all the <var>$Web_Realm</var> calls for a port in an Online are to have the same realm, it probably makes more sense to set the realm with the <var>[[WEBREALM (JANUS DEFINE parameter)|WEBREALM]]</var> parameter on the <var>[[JANUS DEFINE|JANUS DEFINE]]</var> command for the port.


If all the $Web_Realm calls for a port in an Online are to have the same realm, it probably makes more sense to set the realm with the WEBREALM parameter () on the JANUS DEFINE command for the port.
<li>While <var>$Web_Realm</var> can be used in any code, its most common use would be in [[JANUS WEB exception rules|exception rules]], especially those associated with logon processing such as LOGONERR and NEWPASSWORD.
 
While $Web_Realm can be used in any code, its most common use would be in exception rules (), especially those associated with logon processing such as LOGONERR and NEWPASSWORD.


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

Latest revision as of 22:00, 5 June 2013

Set web "realm" for "Unauthorized" response

$Web_Realm allows the setting of the web "realm" before sending an "Unauthorized" response to the browser.

$Web_Realm is a callable $function, and it takes a single argument and returns a number.

Syntax

%rc = $Web_Realm( realm_name )

Syntax terms

%rc A numeric variable to contain a return code.
realm_name Specifies the name of the realm to which a userid and password combination applies. This is a required parameter.

Usage notes

  • Web realms can serve several purposes:
    • By having multiple realms for a single host, different URLs could be made available to different sets of users.
    • The realm could be used to send an arbitrary message to the browser to appear in a login pop-up window.
    • Realms could be dynamically generated to prevent browsers from caching userids and passwords at public workstations.
  • The realm sent by $Web_Realm is not sent to a browser unless a status of 401 ("Unauthorized") is sent to the browser. This means that a $Web_Realm call is meaningless unless followed by a $Web_Done with a status code of 401, for example:

    %rc = $Web_Realm('Toxico Database Systems') %rc = $Web_Done(401, 'Unauthorized')

  • If all the $Web_Realm calls for a port in an Online are to have the same realm, it probably makes more sense to set the realm with the WEBREALM parameter on the JANUS DEFINE command for the port.
  • While $Web_Realm can be used in any code, its most common use would be in exception rules, especially those associated with logon processing such as LOGONERR and NEWPASSWORD.