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 marek 1.21 @return AuthenticationStatus holding http status code and error detail
|
67 kumpf 1.4 */
|
68 marek 1.21 AuthenticationStatus 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 marek 1.21 @return AuthenticationStatus holding http status code and error detail
|
77 kumpf 1.4 */
|
78 marek 1.21 AuthenticationStatus 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 marek 1.20 @param authInfo Reference to AuthenticationInfo object that holds the
86 authentication information for the given connection.
|
87 marek 1.21 @return AuthenticationStatus holding http status code and error detail
|
88 sushma.fernandes 1.11 */
|
89 marek 1.21 AuthenticationStatus validateUserForHttpAuth(
|
90 marek 1.20 const String& userName,
91 AuthenticationInfo* authInfo);
|
92 sushma.fernandes 1.11
|
93 kumpf 1.4 /** Constructs the Pegasus Local authentication challenge header.
94 @param authHeader String containing the Authorization header
95 @param authInfo reference to AuthenticationInfo object that holds the
96 authentication information for the given connection.
97 @return String containing the authentication challenge
98 */
|
99 mike 1.2 String getPegasusAuthResponseHeader(
|
100 kumpf 1.3 const String& authHeader,
|
101 mike 1.2 AuthenticationInfo* authInfo);
102
|
103 kumpf 1.4 /** Constructs the HTTP authentication challenge header.
104 @return String containing the authentication challenge
105 */
|
106 gerarda 1.7 #ifdef PEGASUS_KERBEROS_AUTHENTICATION
|
107 mike 1.17 String AuthenticationManager::getHttpAuthResponseHeader(
|
108 kumpf 1.14 AuthenticationInfo* authInfo = 0);
|
109 gerarda 1.7 #else
|
110 mike 1.2 String getHttpAuthResponseHeader();
|
111 gerarda 1.7 #endif
|
112 sushma.fernandes 1.11
|
113 dl.meetei 1.21.10.1 static Boolean isRemotePrivilegedUserAccessAllowed( String & userName);
|
114 marek 1.13
|
115 mike 1.2 private:
116
117 Authenticator* _getLocalAuthHandler();
118
119 Authenticator* _getHttpAuthHandler();
|
120 kumpf 1.4
121 Authenticator* _localAuthHandler;
122 Authenticator* _httpAuthHandler;
123 String _httpAuthType;
|
124 mike 1.2
125 };
126
127 PEGASUS_NAMESPACE_END
128
129 #endif /* Pegasus_AuthenticationManager_h */
130
|