Barracuda Application Server C/C++ Reference
NO
FormAuthenticator.h
1 /*
2  * ____ _________ __ _
3  * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4  * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5  * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6  * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7  * /____/
8  *
9  * Barracuda Embedded Web-Server
10  ****************************************************************************
11  * HEADER
12  *
13  * $Id: FormAuthenticator.h 4915 2021-12-01 18:26:55Z wini $
14  *
15  * COPYRIGHT: Real Time Logic LLC, 2003 - 2017
16  *
17  * This software is copyrighted by and is the sole property of Real
18  * Time Logic LLC. All rights, title, ownership, or other interests in
19  * the software remain the property of Real Time Logic LLC. This
20  * software may only be used in accordance with the terms and
21  * conditions stipulated in the corresponding license agreement under
22  * which the software has been supplied. Any unauthorized use,
23  * duplication, transmission, distribution, or disclosure of this
24  * software is expressly forbidden.
25  *
26  * This Copyright notice may not be removed or modified without prior
27  * written consent of Real Time Logic LLC.
28  *
29  * Real Time Logic LLC. reserves the right to modify this software
30  * without notice.
31  *
32  * http://www.realtimelogic.com
33  ****************************************************************************
34  *
35  */
36 
37 #ifndef __FormAuthenticator_h
38 #define __FormAuthenticator_h
39 
40 #include <AuthenticatedUser.h>
41 
42 #ifndef __DOXYGEN__
43 typedef struct
44 {
45  AuthenticatedUser superClass; /*as if inherited*/
46  const char* errorMessagePage; /*Path to a user defined error page.*/
47  BaBool isFirstTime;
48 } FormAuthUser;
49 #endif
50 
64 typedef struct FormAuthenticator
65 #ifdef __cplusplus
66 : public AuthenticatorIntf
67 {
76  UserIntf* userDbIntf, const char* realm, LoginRespIntf* sendLogin);
77 
90  void setLoginTracker(LoginTracker* tracker);
91 
98  void setSecure();
99 
100 #else
101 {
102  AuthenticatorIntf superClass; /*as if inherited*/
103 #endif
104  UserIntf* userDbIntf;
105  LoginTracker* tracker;
106  char* realm;
107  LoginRespIntf* sendLogin;
108  BaBool secure;
109  U8 aesKey[32];
111 
112 
113 #ifdef __cplusplus
114 extern "C" {
115 #endif
116 BA_API void FormAuthenticator_constructor(
118  UserIntf* userDbIntf,
119  const char* realm,
120  LoginRespIntf* login);
121 
122 #define FormAuthenticator_destructor(o) do { \
123  if((o)->realm) baFree((o)->realm); (o)->realm=0;} while(0)
124 
125 #define FormAuthenticator_setLoginTracker(o,loginTracker) \
126  (o)->tracker=loginTracker
127 
128 #define FormAuthenticator_setSecure(o) (o)->secure=TRUE
129 
130 #ifdef __cplusplus
131 }
132 inline FormAuthenticator::FormAuthenticator(UserIntf* userDbIntf,
133  const char* realm,
134  LoginRespIntf* login) {
135  FormAuthenticator_constructor(
136  this, userDbIntf, realm, login);
137 }
139  FormAuthenticator_setLoginTracker(this, tracker);
140 }
142  FormAuthenticator_setSecure(this);
143 }
144 #endif
145  /* end of Authentication */
147 
148 
149 #endif
FormAuthenticator::setSecure
void setSecure()
Set authenticator into secure mode and accept only SSL connections.
Definition: FormAuthenticator.h:141
LoginRespIntf
The LoginRespIntf is an abstract class, which must be implemented when using one of DigestAuthenticat...
Definition: AuthenticatedUser.h:459
FormAuthenticator::setLoginTracker
void setLoginTracker(LoginTracker *tracker)
Prevent dictionary attacks.
Definition: FormAuthenticator.h:138
AuthenticatedUser
Abstract base class implemented by BasicAuthUser, FormAuthUser and DigestAuthUser.
Definition: AuthenticatedUser.h:243
LoginTracker
The LoginTracker class is an optional security enhancement that can be installed in an instance of on...
Definition: AuthenticatedUser.h:810
FormAuthenticator
Implements Form-Based Authentication.
Definition: FormAuthenticator.h:67
UserIntf
Interface class used by the Authentication classes.
Definition: AuthenticatedUser.h:174
AuthenticatorIntf
Abstract interface class implemented by DigestAuthenticator, FormAuthenticator and DigestAuthenticato...
Definition: AuthenticatedUser.h:394