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 4915 2021-12-01 18:26:55Z 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
77 static void setAutHeader(const char* realm, HttpResponse* response);
78
82 void setStrictMode(bool enableStrictMode=false);
83
84#else
85{
86 AuthenticatorIntf superClass; /*as if inherited*/
87#endif
88 UserIntf* userDbIntf;
89 LoginTracker* tracker;
90 char* realm;
91 LoginRespIntf* sendLogin;
92 BaBool strictMode;
93 BaBool filterMsDomain; /* If remove MS domain name prefix */
95
96
97#ifdef __cplusplus
98extern "C" {
99#endif
100BA_API void DigestAuthenticator_constructor(
102 UserIntf* userDbIntf,
103 const char* realm,
104 LoginRespIntf* sendLogin);
105BA_API void DigestAuthenticator_destructor(DigestAuthenticator* o);
106#define DigestAuthenticator_setLoginTracker(o,loginTracker) \
107 (o)->tracker=loginTracker
108#define DigestAuthenticator_setFilterMsDomain(o, state) \
109 (o)->filterMsDomain=state
110BA_API void DigestAuthenticator_setAutHeader(
111 const char*,HttpResponse*);
112#define DigestAuthenticator_setStrictMode(o, enableStrictMode) \
113 (o)->strictMode=enableStrictMode
114BA_API BaBool DigestAuthenticator_isDigest(AuthenticatedUser* user);
115#ifdef __cplusplus
116}
117inline DigestAuthenticator::DigestAuthenticator(UserIntf* userDbIntf,
118 const char* realm,
119 LoginRespIntf* sendLogin) {
120 DigestAuthenticator_constructor(this,userDbIntf,realm,sendLogin);
121}
123 DigestAuthenticator_setLoginTracker(this, tracker);
124}
126 const char* realm, HttpResponse* resp) {
127 DigestAuthenticator_setAutHeader(realm,resp); }
128inline void DigestAuthenticator::setStrictMode(bool enableStrictMode) {
129 DigestAuthenticator_setStrictMode(this, enableStrictMode ? TRUE : FALSE);
130}
131
132#endif
133 /* end of Authentication */
135
136#endif
void setLoginTracker(LoginTracker *tracker)
Prevent dictionary attacks.
Definition: DigestAuthenticator.h:122
void setStrictMode(bool enableStrictMode=false)
Enable strict mode.
Definition: DigestAuthenticator.h:128
static void setAutHeader(const char *realm, HttpResponse *response)
Sets a HTTP digest authenticate header and sets status to.
Definition: DigestAuthenticator.h:125
Abstract base class implemented by BasicAuthUser, FormAuthUser and DigestAuthUser.
Definition: AuthenticatedUser.h:243
Abstract interface class implemented by DigestAuthenticator, FormAuthenticator and DigestAuthenticato...
Definition: AuthenticatedUser.h:395
Implements Digest Authentication.
Definition: DigestAuthenticator.h:55
This object is used when sending response messages back to the client.
Definition: HttpServer.h:1178
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