Barracuda Application Server C/C++ Reference
NO
DigestAuthenticator.h
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 ****************************************************************************
11 * HEADER
12 *
13 * $Id: DigestAuthenticator.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 __DigestAuthenticator_h
38#define __DigestAuthenticator_h
39
40#include <AuthenticatedUser.h>
41
52typedef struct DigestAuthenticator
53#ifdef __cplusplus
54: public AuthenticatorIntf
55{
57
64 DigestAuthenticator(UserIntf* userDbIntf,
65 const char* realm,
66 LoginRespIntf* sendLogin);
67
71 void setLoginTracker(LoginTracker* tracker);
72
82 static int setAutHeader(const char* realm, HttpResponse* response);
83
88 void setStrictMode(bool enableStrictMode=false);
89
90#else
91{
92 AuthenticatorIntf superClass; /*as if inherited*/
93#endif
94 UserIntf* userDbIntf;
95 LoginTracker* tracker;
96 char* realm;
97 LoginRespIntf* sendLogin;
98 BaBool strictMode;
99 BaBool filterMsDomain; /* If remove MS domain name prefix */
101
102
103#ifdef __cplusplus
104extern "C" {
105#endif
106BA_API void DigestAuthenticator_constructor(
108 UserIntf* userDbIntf,
109 const char* realm,
110 LoginRespIntf* sendLogin);
111BA_API void DigestAuthenticator_destructor(DigestAuthenticator* o);
112#define DigestAuthenticator_setLoginTracker(o,loginTracker) \
113 (o)->tracker=loginTracker
114#define DigestAuthenticator_setFilterMsDomain(o, state) \
115 (o)->filterMsDomain=state
116/* Returns 0 on success (including an ignored include), E_MALLOC when header
117 * storage fails, or E_IS_COMMITTED. Failure does not set status 401. */
118BA_API int DigestAuthenticator_setAutHeader(
119 const char*,HttpResponse*);
120#define DigestAuthenticator_setStrictMode(o, enableStrictMode) \
121 (o)->strictMode=enableStrictMode
122BA_API BaBool DigestAuthenticator_isDigest(AuthenticatedUser* user);
123#ifdef __cplusplus
124}
125inline DigestAuthenticator::DigestAuthenticator(UserIntf* userDbIntf,
126 const char* realm,
127 LoginRespIntf* sendLogin) {
128 DigestAuthenticator_constructor(this,userDbIntf,realm,sendLogin);
129}
131 DigestAuthenticator_setLoginTracker(this, tracker);
132}
134 const char* realm, HttpResponse* resp) {
135 return DigestAuthenticator_setAutHeader(realm,resp); }
136inline void DigestAuthenticator::setStrictMode(bool enableStrictMode) {
137 DigestAuthenticator_setStrictMode(this, enableStrictMode ? TRUE : FALSE);
138}
139
140#endif
141 /* end of Authentication */
143
144#endif
void setLoginTracker(LoginTracker *tracker)
Prevent dictionary attacks.
Definition: DigestAuthenticator.h:130
static int setAutHeader(const char *realm, HttpResponse *response)
Sets an HTTP Digest authentication challenge and status code.
Definition: DigestAuthenticator.h:133
void setStrictMode(bool enableStrictMode=false)
Enable strict RFC-compatible Digest mode.
Definition: DigestAuthenticator.h:136
Abstract base class implemented by BasicAuthUser, FormAuthUser and DigestAuthUser.
Definition: AuthenticatedUser.h:246
Abstract interface class implemented by DigestAuthenticator, FormAuthenticator and DigestAuthenticato...
Definition: AuthenticatedUser.h:398
Implements HTTP Digest authentication.
Definition: DigestAuthenticator.h:55
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