Author:
Tiago Cogumbreiro <cogumbreiro@users.sf.net>
License:
Copyright (c) 2005, Tiago Cogumbreiro
<cogumbreiro@users.sf.net>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice,
this list of conditions and the following disclaimer in the
documentation
and/or other materials provided with the distribution.
* Neither the name of Sylvain Hellegouarch nor the names of his
contributors may be used to endorse or promote products
derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
|
|
|
digestAuth(realm,
algorithm=' MD5 ' ,
nonce=None,
qop=' auth ' )
Challenges the client for a Digest authentication. |
source code
|
|
|
basicAuth(realm)
Challengenes the client for a Basic authentication. |
source code
|
|
|
doAuth(realm)
'doAuth' function returns the challenge string b giving priority over
Digest and fallback to Basic authentication when the browser doesn't
support the first one. |
source code
|
|
|
|
|
|
|
parseAuthorization(credentials)
parseAuthorization will convert the value of the 'Authorization' key
in the HTTP header to a map itself. |
source code
|
|
|
md5SessionKey(params,
password)
If the "algorithm" directive's value is
"MD5-sess", then A1 [the session key] is calculated only
once - on the first request by the client following receipt of a
WWW-Authenticate challenge from the server. |
source code
|
|
|
|
|
|
|
_computeDigestResponse(auth_map,
password,
method=' GET ' ,
A1=None,
**kwargs)
Generates a response respecting the algorithm defined in RFC 2617 |
source code
|
|
|
_checkDigestResponse(auth_map,
password,
method=' GET ' ,
A1=None,
**kwargs)
This function is used to verify the response given by the client when
he tries to authenticate. |
source code
|
|
|
_checkBasicResponse(auth_map,
password,
method=' GET ' ,
encrypt=None,
**kwargs) |
source code
|
|
|
checkResponse(auth_map,
password,
method=' GET ' ,
encrypt=None,
**kwargs)
'checkResponse' compares the auth_map with the password and
optionally other arguments that each implementation might need. |
source code
|
|