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