Barracuda Application Server C/C++ Reference
NO
Authenticator.h
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 ****************************************************************************
11 * HEADER
12 *
13 * $Id: Authenticator.h 4915 2021-12-01 18:26:55Z wini $
14 *
15 * COPYRIGHT: Real Time Logic LLC, 2005-2008
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 __Authenticator_h
38#define __Authenticator_h
39
40#include "BasicAuthenticator.h"
41#include "DigestAuthenticator.h"
42#include "FormAuthenticator.h"
43
44
55typedef struct Authenticator
56#ifdef __cplusplus
57 : public AuthenticatorIntf
58{
68 Authenticator(UserIntf* userDbIntf,
69 const char* realm,
70 LoginRespIntf* sendLogin);
71
72
76 void setLoginTracker(LoginTracker* tracker);
77
81
85
89#else
90 {
91 AuthenticatorIntf superClass; /*as if inherited*/
92#endif
93 BasicAuthenticator basicAuth;
94 DigestAuthenticator digestAuth;
95 FormAuthenticator formAuth;
96 int authpref;
98
99
100#ifdef __cplusplus
101extern "C" {
102#endif
103BA_API void Authenticator_constructor(Authenticator* o,
104 UserIntf* userDbIntf,
105 const char* realm,
106 LoginRespIntf* sendLogin);
107BA_API void Authenticator_destructor(Authenticator* o);
108#define Authenticator_setLoginTracker(o, loginTracker)\
109 BasicAuthenticator_setLoginTracker(&(o)->basicAuth, loginTracker),\
110 DigestAuthenticator_setLoginTracker(&(o)->digestAuth, loginTracker),\
111 FormAuthenticator_setLoginTracker(&(o)->formAuth, loginTracker)
112#define Authenticator_getBasicAuthenticator(o) (&(o)->basicAuth)
113#define Authenticator_getDigestAuthenticator(o) (&(o)->digestAuth)
114#define Authenticator_getFormAuthenticator(o) (&(o)->formAuth)
115#ifdef __cplusplus
116}
118 UserIntf* userDbIntf,
119 const char* realm,
120 LoginRespIntf* sendLogin) {
121 Authenticator_constructor(this, userDbIntf, realm, sendLogin);
122}
124 Authenticator_setLoginTracker(this, tracker);
125}
127 return Authenticator_getBasicAuthenticator(this);
128}
130 return Authenticator_getDigestAuthenticator(this);
131}
133 return Authenticator_getFormAuthenticator(this);
134}
135#endif
136 /* end of Authentication */
138
139
140#endif
BasicAuthenticator * getBasicAuthenticator()
Get the internal BasicAuthenticator.
Definition: Authenticator.h:126
FormAuthenticator * getFormAuthenticator()
Get the internal FormAuthenticator.
Definition: Authenticator.h:132
Authenticator(UserIntf *userDbIntf, const char *realm, LoginRespIntf *sendLogin)
Definition: Authenticator.h:117
void setLoginTracker(LoginTracker *tracker)
Prevent dictionary attacks.
Definition: Authenticator.h:123
DigestAuthenticator * getDigestAuthenticator()
Get the internal DigestAuthenticator.
Definition: Authenticator.h:129
Abstract interface class implemented by DigestAuthenticator, FormAuthenticator and DigestAuthenticato...
Definition: AuthenticatedUser.h:395
This class implements HTTP Basic, HTTP Digest, and Form-Based Authentication.
Definition: Authenticator.h:58
Implements Basic Authentication.
Definition: BasicAuthenticator.h:54
Implements Digest Authentication.
Definition: DigestAuthenticator.h:55
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