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 5360 2022-11-27 19:03:40Z 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__
43typedef 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
64typedef 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
114extern "C" {
115#endif
116BA_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) \
124 baFree((o)->realm); \
125 (o)->realm=0; \
126 } while(0)
127
128#define FormAuthenticator_setLoginTracker(o,loginTracker) \
129 (o)->tracker=loginTracker
130
131#define FormAuthenticator_setSecure(o) (o)->secure=TRUE
132
133#ifdef __cplusplus
134}
135inline FormAuthenticator::FormAuthenticator(UserIntf* userDbIntf,
136 const char* realm,
137 LoginRespIntf* login) {
138 FormAuthenticator_constructor(
139 this, userDbIntf, realm, login);
140}
142 FormAuthenticator_setLoginTracker(this, tracker);
143}
145 FormAuthenticator_setSecure(this);
146}
147#endif
148 /* end of Authentication */
150
151
152#endif
void setSecure()
Set authenticator into secure mode and accept only SSL connections.
Definition: FormAuthenticator.h:144
void setLoginTracker(LoginTracker *tracker)
Prevent dictionary attacks.
Definition: FormAuthenticator.h:141
Abstract base class implemented by BasicAuthUser, FormAuthUser and DigestAuthUser.
Definition: AuthenticatedUser.h:243
Abstract interface class implemented by DigestAuthenticator, FormAuthenticator and DigestAuthenticato...
Definition: AuthenticatedUser.h:395
Implements Form-Based Authentication.
Definition: FormAuthenticator.h:67
The LoginRespIntf is an abstract class, which must be implemented when using one of DigestAuthenticat...
Definition: AuthenticatedUser.h:460
The LoginTracker class is an optional security enhancement that can be installed in an instance of on...
Definition: AuthenticatedUser.h:812
Interface class used by the Authentication classes.
Definition: AuthenticatedUser.h:174