PEP 55 Update license on source files to current license text and date
[tpot/pegasus/.git] / src / Pegasus / Security / Authentication / LocalAuthenticationHandler.h
1 //%2003////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development
4 // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
6 // IBM Corp.; EMC Corporation, The Open Group.
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to
10 // deal in the Software without restriction, including without limitation the
11 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
12 // sell copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 // 
15 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
16 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
17 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
18 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 //
24 //==============================================================================
25 //
26 // Author: Nag Boranna, Hewlett-Packard Company(nagaraja_boranna@hp.com)
27 //
28 // Modified By:
29 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_LocalAuthenticationHandler_h
33 #define Pegasus_LocalAuthenticationHandler_h
34
35 #include <Pegasus/Common/Config.h>
36 #include <Pegasus/Common/String.h>
37
38 #include "LocalAuthenticator.h"
39 #include "Authenticator.h"
40
41 #include <Pegasus/Security/Authentication/Linkage.h>
42
43 PEGASUS_NAMESPACE_BEGIN
44
45
46 /** 
47    This class implements the AuthenticationHandler for Pegasus Local authentication. 
48    It extends the Authenticator and provides the implementation.
49 */
50
51 class PEGASUS_SECURITY_LINKAGE LocalAuthenticationHandler : public Authenticator
52 {
53 public:
54
55     /** Constructors  */
56     LocalAuthenticationHandler();
57
58     /** Destructor  */
59     ~LocalAuthenticationHandler();
60     
61     /** Verify the authentication of the user passed in the authorization header.
62         @param authHeader String containing the Authorization header
63         @param authInfo Reference to AuthenticationInfo object
64         @return true on successful authentication, false otherwise
65     */
66     Boolean authenticate(
67         const String& authHeader, 
68         AuthenticationInfo* authInfo);
69     
70     /** Construct and return the Pegasus Local authentication challenge header
71         @param authType String containing the HTTP authentication type
72         @param userName String containing the user name
73         @param authInfo Reference to AuthenticationInfo object
74         @return A string containing the authentication challenge header.
75     */
76     String getAuthResponseHeader(
77         const String& authType = String::EMPTY, 
78         const String& userName = String::EMPTY, 
79         AuthenticationInfo* authInfo = 0);    
80
81 private:
82
83     LocalAuthenticator* _localAuthenticator;
84 };
85
86 PEGASUS_NAMESPACE_END
87
88 #endif /* Pegasus_LocalAuthenticationHandler_h*/