Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
BasicAuthenticator.h
Go to the documentation of this file.
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 ****************************************************************************
11 * HEADER
12 *
13 * $Id: BasicAuthenticator.h 5978 2026-09-11 16:13:48Z 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
39#ifndef __BasicAuthenticator_h
40#define __BasicAuthenticator_h
41
42#include <AuthenticatedUser.h>
43
53typedef struct BasicAuthenticator
54#ifdef __cplusplus
55: public AuthenticatorIntf
56{
71 BasicAuthenticator(UserIntf* userDbIntf,
72 const char* realm,
73 LoginRespIntf* sendLogin);
74
80 void setLoginTracker(LoginTracker* tracker);
81
93 static int setAutHeader(const char* realm, HttpResponse* response);
94
95#else
96{
97 AuthenticatorIntf superClass; /*as if inherited*/
98#endif
99 UserIntf* userDbIntf;
100 LoginTracker* tracker;
101 char* realm;
102 LoginRespIntf* sendLogin;
103 BaBool filterMsDomain; /* If remove MS domain name prefix */
105
106
107#ifdef __cplusplus
108extern "C" {
109#endif
118 UserIntf* userDbIntf,
119 const char* realm,
120 LoginRespIntf* sendLogin);
129#define BasicAuthenticator_setLoginTracker(o,loginTracker) \
130 (o)->tracker=loginTracker
136#define BasicAuthenticator_setFilterMsDomain(o, state) \
137 (o)->filterMsDomain=state
138/* Returns 0 on success (including an ignored include), E_MALLOC when header
139 * storage fails, or E_IS_COMMITTED. Failure does not set status 401. */
145 const char* realm,HttpResponse* resp);
146#ifdef __cplusplus
147}
149 const char* realm,
150 LoginRespIntf* sendLogin) {
152 this,userDbIntf,realm,sendLogin); }
154 BasicAuthenticator_setLoginTracker(this, tracker); }
156 const char* realm, HttpResponse* resp) {
157 return BasicAuthenticator_setAutHeader(realm,resp); }
158#endif
159 /* end of Authentication */
161
162#endif
BA_API int BasicAuthenticator_setAutHeader(const char *realm, HttpResponse *resp)
C form of BasicAuthenticator::setAutHeader.
BA_API void BasicAuthenticator_destructor(BasicAuthenticator *o)
Release authenticator-owned realm storage after detaching all users.
#define BasicAuthenticator_setLoginTracker(o, loginTracker)
C form of BasicAuthenticator::setLoginTracker.
Definition: BasicAuthenticator.h:129
BA_API void BasicAuthenticator_constructor(BasicAuthenticator *o, UserIntf *userDbIntf, const char *realm, LoginRespIntf *sendLogin)
C form of BasicAuthenticator::BasicAuthenticator.
void setLoginTracker(LoginTracker *tracker)
Configure login-attempt tracking.
Definition: BasicAuthenticator.h:153
static int setAutHeader(const char *realm, HttpResponse *response)
Sets an HTTP Basic authentication challenge and status code.
Definition: BasicAuthenticator.h:155
U8 BaBool
Boolean stored in an unsigned byte; FALSE is zero and TRUE is one.
Definition: GenPrimT.h:118
Abstract interface class implemented by DigestAuthenticator, FormAuthenticator and BasicAuthenticator...
Definition: AuthenticatedUser.h:425
Implements HTTP Basic authentication.
Definition: BasicAuthenticator.h:56
BasicAuthenticator()
Leave storage uninitialized; call BasicAuthenticator_constructor before use.
Definition: BasicAuthenticator.h:58
This object is used when sending response messages back to the client.
Definition: HttpServer.h:1379
The LoginRespIntf is an abstract class, which must be implemented when using one of DigestAuthenticat...
Definition: AuthenticatedUser.h:504
The LoginTracker class is an optional security enhancement that can be installed in an instance of on...
Definition: AuthenticatedUser.h:891
User database interface used by the authentication classes.
Definition: AuthenticatedUser.h:195