version 1.1.2.1, 2001/10/06 00:33:10
|
version 1.1.2.2, 2001/11/20 22:21:45
|
|
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
| |
|
#include <Pegasus/Common/FileSystem.h> |
#include <Pegasus/Security/Authentication/LocalAuthFile.h> | #include <Pegasus/Security/Authentication/LocalAuthFile.h> |
#include "SecureLocalAuthenticator.h" | #include "SecureLocalAuthenticator.h" |
| |
|
|
| |
Boolean SecureLocalAuthenticator::authenticate(String userName, String password) | Boolean SecureLocalAuthenticator::authenticate(String userName, String password) |
{ | { |
// not supported for local authentication, so return false. |
// |
|
// not supported, so return false. |
|
// |
return (false); | return (false); |
} | } |
| |
|
|
// | // |
Boolean SecureLocalAuthenticator::authenticate | Boolean SecureLocalAuthenticator::authenticate |
( | ( |
String userName, |
String filePath, |
String secretReceived, | String secretReceived, |
String secretKept | String secretKept |
) | ) |
|
|
} | } |
} | } |
| |
// ATTN: Delete the authentication secret file |
// |
//if (!localAuthFile.deleteFile()) |
// remove the auth file created for this user request |
//{ |
// |
//} |
if (FileSystem::exists(filePath)) |
|
{ |
|
if (!FileSystem::removeFile(filePath)) |
|
{ |
|
//ATTN: Log an error message |
|
} |
|
} |
| |
return (authenticated); | return (authenticated); |
} | } |
|
|
String userName, | String userName, |
String& challenge) | String& challenge) |
{ | { |
String responseHeader = String::EMPTY; |
String responseHeader = "WWW-Authenticate: Local \""; |
| |
// | // |
// create a file using user name and write a random number in it. | // create a file using user name and write a random number in it. |
|
|
// | // |
// get the challenge string | // get the challenge string |
// | // |
challenge = localAuthFile.getChallengeString(); |
String temp = localAuthFile.getChallengeString(); |
|
challenge = temp; |
| |
// | // |
// build response header with file path and challenge string. | // build response header with file path and challenge string. |
// | // |
responseHeader.assign(filePath); |
responseHeader.append(filePath); |
|
responseHeader.append("\""); |
| |
return (responseHeader); | return (responseHeader); |
} | } |