SetAuthentication (HttpRequest subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
 
m (1 revision)
 
(12 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<span class="pageSubtitle"><section begin=dpl_desc/><section end=dpl_desc/></span>
{{Template:HttpRequest:SetAuthentication subtitle}}
[[Category:HTTPRequest methods|SetAuthentication subroutine]]
The <var>SetAuthentication</var> [[Notation conventions for methods#Callable functions|callable]] method lets you present credentials to a password-protected portion of a website.  Such portions of a site are those where the server returns a 401 return code (authentication is required) for a request-for-URL in that portion of the site.


This [[Notation conventions for methods#Callable methods|callable]] method lets you present
credentials to a password-protected portion of a website.
Such portions of a site are those where the server returns
a 401 return code (authentication is required) for a
request-for-URL in that portion of the site.
==Syntax==
==Syntax==
<p class="syntax">%httpreq:SetAuthentication(userid, pw, realm)
{{Template:HttpRequest:SetAuthentication syntax}}
</p>
 
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%httpreq</th>
<tr><th>httpRequest</th>
<td>An instantiated HTTPRequest object.
<td>A previously defined and instantiated <var>HttpRequest</var> object.</td></tr>
</td></tr>
<tr><th>userID</th>
<tr><th>userid</th>
<td>The user name for the protected area.</td></tr>
<td>The user name for the protected area.
<tr><th>password</th>
</td></tr>
<td>The password for the protected area.</td></tr>
<tr><th>pw</th>
<td>The password for the protected area.
</td></tr>
<tr><th>realm</th>
<tr><th>realm</th>
<td>The protected area of the site.
<td>The protected area of the site.</td></tr>
</table>


</td></tr></table>
==Usage notes==
==Usage notes==
<ul>
<ul>
<li>Once a <var>SetAuthentication</var> method is
<li>Once a <var>SetAuthentication</var> method is issued, the information passed is used to respond to any request to which the server responds with a <code>401 http</code> status code.
issued, the information passed is used to respond to
<li>The most recent <var>SetAuthentication</var> issued is the one that will be in effect.
any request to which the server responds with a <code>401 http</code>
</ul>
status code.
 
<li>The most recent <var>SetAuthentication</var> issued is the one
==See also==
that will be in effect.
<ul>
<li>Authentication values created with <var>SetAuthentication</var> are cleared
<li>Authentication values created with <var>SetAuthentication</var> are cleared with the <var>[[RemoveAuthentication (HttpRequest subroutine)|RemoveAuthentication]]</var> method.
with the <var>[[RemoveAuthentication (HTTPRequest subroutine)|RemoveAuthentication]]</var> method.
</ul>
</ul>
{{Template:HttpRequest:SetAuthentication footer}}

Latest revision as of 19:40, 14 July 2011

Issue username/password credentials (HttpRequest class)

The SetAuthentication callable method lets you present credentials to a password-protected portion of a website. Such portions of a site are those where the server returns a 401 return code (authentication is required) for a request-for-URL in that portion of the site.

Syntax

httpRequest:SetAuthentication( userID, password, realm)

Syntax terms

httpRequest A previously defined and instantiated HttpRequest object.
userID The user name for the protected area.
password The password for the protected area.
realm The protected area of the site.

Usage notes

  • Once a SetAuthentication method is issued, the information passed is used to respond to any request to which the server responds with a 401 http status code.
  • The most recent SetAuthentication issued is the one that will be in effect.

See also

  • Authentication values created with SetAuthentication are cleared with the RemoveAuthentication method.