SetAuthentication (HttpRequest subroutine): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (1 revision)
Line 11: Line 11:
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%httpreq</th>
<tr><th>%httpreq</th>
<td>An instantiated <var>HTTPRequest</var> object.
<td>An instantiated <var>HttpRequest</var> object.
</td></tr>
</td></tr>
<tr><th>userid</th>
<tr><th>userid</th>
Line 32: Line 32:
that will be in effect.
that will be in effect.
<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>
==See also==
==See also==
{{Template:HttpRequest:SetAuthentication footer}}
{{Template:HttpRequest:SetAuthentication footer}}

Revision as of 20:17, 16 June 2011

Issue username/password credentials (HttpRequest class)


This 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

%httpreq An instantiated HttpRequest object.
userid The user name for the protected area.
pw 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.
  • Authentication values created with SetAuthentication are cleared with the RemoveAuthentication method.

See also