Barracuda Application Server C/C++ Reference
NO
BasicAuthenticator.h
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 ****************************************************************************
11 * HEADER
12 *
13 * $Id: BasicAuthenticator.h 5970 2026-09-11 08:41:16Z wini $
14 *
15 * COPYRIGHT: Real Time Logic LLC, 2003-2026
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 __BasicAuthenticator_h
38#define __BasicAuthenticator_h
39
40#include <AuthenticatedUser.h>
41
51typedef struct BasicAuthenticator
52#ifdef __cplusplus
53: public AuthenticatorIntf
54{
62 BasicAuthenticator(UserIntf* userDbIntf,
63 const char* realm,
64 LoginRespIntf* sendLogin);
65
69 void setLoginTracker(LoginTracker* tracker);
70
80 static int setAutHeader(const char* realm, HttpResponse* response);
81
82#else
83{
84 AuthenticatorIntf superClass; /*as if inherited*/
85#endif
86 UserIntf* userDbIntf;
87 LoginTracker* tracker;
88 char* realm;
89 LoginRespIntf* sendLogin;
90 BaBool filterMsDomain; /* If remove MS domain name prefix */
92
93
94#ifdef __cplusplus
95extern "C" {
96#endif
97BA_API void BasicAuthenticator_constructor(
99 UserIntf* userDbIntf,
100 const char* realm,
101 LoginRespIntf* sendLogin);
102BA_API void BasicAuthenticator_destructor(BasicAuthenticator* o);
103#define BasicAuthenticator_setLoginTracker(o,loginTracker) \
104 (o)->tracker=loginTracker
105#define BasicAuthenticator_setFilterMsDomain(o, state) \
106 (o)->filterMsDomain=state
107/* Returns 0 on success (including an ignored include), E_MALLOC when header
108 * storage fails, or E_IS_COMMITTED. Failure does not set status 401. */
109BA_API int BasicAuthenticator_setAutHeader(
110 const char* realm,HttpResponse* resp);
111#ifdef __cplusplus
112}
113inline BasicAuthenticator::BasicAuthenticator(UserIntf* userDbIntf,
114 const char* realm,
115 LoginRespIntf* sendLogin) {
116 BasicAuthenticator_constructor(
117 this,userDbIntf,realm,sendLogin); }
119 BasicAuthenticator_setLoginTracker(this, tracker); }
121 const char* realm, HttpResponse* resp) {
122 return BasicAuthenticator_setAutHeader(realm,resp); }
123#endif
124 /* end of Authentication */
126
127#endif
void setLoginTracker(LoginTracker *tracker)
Prevent dictionary attacks.
Definition: BasicAuthenticator.h:118
static int setAutHeader(const char *realm, HttpResponse *response)
Sets an HTTP Basic authentication challenge and status code.
Definition: BasicAuthenticator.h:120
Abstract interface class implemented by DigestAuthenticator, FormAuthenticator and DigestAuthenticato...
Definition: AuthenticatedUser.h:398
Implements HTTP Basic authentication.
Definition: BasicAuthenticator.h:54
This object is used when sending response messages back to the client.
Definition: HttpServer.h:1194
The LoginRespIntf is an abstract class, which must be implemented when using one of DigestAuthenticat...
Definition: AuthenticatedUser.h:463
The LoginTracker class is an optional security enhancement that can be installed in an instance of on...
Definition: AuthenticatedUser.h:809
User database interface used by the authentication classes.
Definition: AuthenticatedUser.h:177