1 martin 1.18 //%LICENSE////////////////////////////////////////////////////////////////
|
2 martin 1.19 //
|
3 martin 1.18 // Licensed to The Open Group (TOG) under one or more contributor license
4 // agreements. Refer to the OpenPegasusNOTICE.txt file distributed with
5 // this work for additional information regarding copyright ownership.
6 // Each contributor licenses this file to you under the OpenPegasus Open
7 // Source License; you may not use this file except in compliance with the
8 // License.
|
9 martin 1.19 //
|
10 martin 1.18 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
|
16 martin 1.19 //
|
17 martin 1.18 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
|
19 martin 1.19 //
|
20 martin 1.18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
21 martin 1.19 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
22 martin 1.18 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23 // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
24 // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
25 // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26 // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
27 martin 1.19 //
|
28 martin 1.18 //////////////////////////////////////////////////////////////////////////
|
29 mike 1.2 //
30 //%/////////////////////////////////////////////////////////////////////////////
31
32 #ifndef Pegasus_AuthenticationManager_h
33 #define Pegasus_AuthenticationManager_h
34
35 #include <Pegasus/Common/Config.h>
|
36 kumpf 1.4
37 #include "Authenticator.h"
|
38 mike 1.2
|
39 chuck 1.6 #include <Pegasus/Security/Authentication/Linkage.h>
|
40 mike 1.2
|
41 gerarda 1.7 #ifdef PEGASUS_KERBEROS_AUTHENTICATION
42 #include <Pegasus/Common/AuthenticationInfo.h>
43 #endif
44
|
45 mike 1.2 PEGASUS_NAMESPACE_BEGIN
46
|
47 kumpf 1.14 /** This class implements the HTTP authentication and Pegasus Local
|
48 kumpf 1.4 authentication mecahnism. It provides methods to perform authentication
49 and to generate authentication challenge headers.
|
50 mike 1.2 */
51
52 class PEGASUS_SECURITY_LINKAGE AuthenticationManager
53 {
54 public:
55
|
56 kumpf 1.4 /**Constructor */
|
57 mike 1.2 AuthenticationManager();
58
|
59 kumpf 1.4 /**Destructor */
|
60 mike 1.2 ~AuthenticationManager();
61
|
62 kumpf 1.4 /** Authenticates the requests from HTTP connections.
63 @param authHeader String containing the Authorization header
64 @param authInfo Reference to AuthenticationInfo object that holds the
65 authentication information for the given connection.
66 @return true on successful authentication, false otherwise
67 */
|
68 mike 1.2 Boolean performHttpAuthentication(
|
69 kumpf 1.3 const String& authHeader,
|
70 mike 1.2 AuthenticationInfo* authInfo);
71
|
72 kumpf 1.4 /** Authenticates the requests from Local connections.
73 @param authHeader String containing the Authorization header
74 @param authInfo Reference to AuthenticationInfo object that holds the
75 authentication information for the given connection.
76 @return true on successful authentication, false otherwise
77 */
|
78 mike 1.2 Boolean performPegasusAuthentication(
|
79 kumpf 1.3 const String& authHeader,
|
80 mike 1.2 AuthenticationInfo* authInfo);
81
|
82 sushma.fernandes 1.11 /** Validates whether the user is a valid user for requests
83 from HTTP connections.
84 @param userName name of the user
85 @return true on successful validation, false otherwise
86 */
87 Boolean validateUserForHttpAuth (const String& userName);
88
|
89 kumpf 1.4 /** Constructs the Pegasus Local authentication challenge header.
90 @param authHeader String containing the Authorization header
91 @param authInfo reference to AuthenticationInfo object that holds the
92 authentication information for the given connection.
93 @return String containing the authentication challenge
94 */
|
95 mike 1.2 String getPegasusAuthResponseHeader(
|
96 kumpf 1.3 const String& authHeader,
|
97 mike 1.2 AuthenticationInfo* authInfo);
98
|
99 kumpf 1.4 /** Constructs the HTTP authentication challenge header.
100 @return String containing the authentication challenge
101 */
|
102 gerarda 1.7 #ifdef PEGASUS_KERBEROS_AUTHENTICATION
|
103 mike 1.17 String AuthenticationManager::getHttpAuthResponseHeader(
|
104 kumpf 1.14 AuthenticationInfo* authInfo = 0);
|
105 gerarda 1.7 #else
|
106 mike 1.2 String getHttpAuthResponseHeader();
|
107 gerarda 1.7 #endif
|
108 sushma.fernandes 1.11
|
109 marek 1.13 static Boolean isRemotePrivilegedUserAccessAllowed(
110 String & userName);
111
|
112 mike 1.2 private:
113
114 Authenticator* _getLocalAuthHandler();
115
116 Authenticator* _getHttpAuthHandler();
|
117 kumpf 1.4
118 Authenticator* _localAuthHandler;
119 Authenticator* _httpAuthHandler;
120 String _httpAuthType;
|
121 mike 1.2
122 };
123
124 PEGASUS_NAMESPACE_END
125
126 #endif /* Pegasus_AuthenticationManager_h */
127
|