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 5813 2026-06-15 10:15:50Z wini $
14 *
15 * COPYRIGHT: Real Time Logic LLC, 2003-2013
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
79 static void setAutHeader(const char* realm, HttpResponse* response);
80
85 void setStrictMode(bool enableStrictMode=false);
86
87#else
88{
89 AuthenticatorIntf superClass; /*as if inherited*/
90#endif
91 UserIntf* userDbIntf;
92 LoginTracker* tracker;
93 char* realm;
94 LoginRespIntf* sendLogin;
95 BaBool strictMode;
96 BaBool filterMsDomain; /* If remove MS domain name prefix */
98
99
100#ifdef __cplusplus
101extern "C" {
102#endif
103BA_API void DigestAuthenticator_constructor(
105 UserIntf* userDbIntf,
106 const char* realm,
107 LoginRespIntf* sendLogin);
108BA_API void DigestAuthenticator_destructor(DigestAuthenticator* o);
109#define DigestAuthenticator_setLoginTracker(o,loginTracker) \
110 (o)->tracker=loginTracker
111#define DigestAuthenticator_setFilterMsDomain(o, state) \
112 (o)->filterMsDomain=state
113BA_API void DigestAuthenticator_setAutHeader(
114 const char*,HttpResponse*);
115#define DigestAuthenticator_setStrictMode(o, enableStrictMode) \
116 (o)->strictMode=enableStrictMode
117BA_API BaBool DigestAuthenticator_isDigest(AuthenticatedUser* user);
118#ifdef __cplusplus
119}
120inline DigestAuthenticator::DigestAuthenticator(UserIntf* userDbIntf,
121 const char* realm,
122 LoginRespIntf* sendLogin) {
123 DigestAuthenticator_constructor(this,userDbIntf,realm,sendLogin);
124}
126 DigestAuthenticator_setLoginTracker(this, tracker);
127}
129 const char* realm, HttpResponse* resp) {
130 DigestAuthenticator_setAutHeader(realm,resp); }
131inline void DigestAuthenticator::setStrictMode(bool enableStrictMode) {
132 DigestAuthenticator_setStrictMode(this, enableStrictMode ? TRUE : FALSE);
133}
134
135#endif
136 /* end of Authentication */
138
139#endif
void setLoginTracker(LoginTracker *tracker)
Prevent dictionary attacks.
Definition: DigestAuthenticator.h:125
void setStrictMode(bool enableStrictMode=false)
Enable strict RFC-compatible Digest mode.
Definition: DigestAuthenticator.h:131
static void setAutHeader(const char *realm, HttpResponse *response)
Sets an HTTP Digest authentication challenge and status code.
Definition: DigestAuthenticator.h:128
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:1186
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