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 
52 typedef 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
98 extern "C" {
99 #endif
100 BA_API void DigestAuthenticator_constructor(
102  UserIntf* userDbIntf,
103  const char* realm,
104  LoginRespIntf* sendLogin);
105 BA_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
110 BA_API void DigestAuthenticator_setAutHeader(
111  const char*,HttpResponse*);
112 #define DigestAuthenticator_setStrictMode(o, enableStrictMode) \
113  (o)->strictMode=enableStrictMode
114 BA_API BaBool DigestAuthenticator_isDigest(AuthenticatedUser* user);
115 #ifdef __cplusplus
116 }
117 inline 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); }
128 inline void DigestAuthenticator::setStrictMode(bool enableStrictMode) {
129  DigestAuthenticator_setStrictMode(this, enableStrictMode ? TRUE : FALSE);
130 }
131 
132 #endif
133  /* end of Authentication */
135 
136 #endif
DigestAuthenticator::setLoginTracker
void setLoginTracker(LoginTracker *tracker)
Prevent dictionary attacks.
Definition: DigestAuthenticator.h:122
LoginRespIntf
The LoginRespIntf is an abstract class, which must be implemented when using one of DigestAuthenticat...
Definition: AuthenticatedUser.h:459
AuthenticatedUser
Abstract base class implemented by BasicAuthUser, FormAuthUser and DigestAuthUser.
Definition: AuthenticatedUser.h:243
LoginTracker
The LoginTracker class is an optional security enhancement that can be installed in an instance of on...
Definition: AuthenticatedUser.h:810
DigestAuthenticator::setStrictMode
void setStrictMode(bool enableStrictMode=false)
Enable strict mode.
Definition: DigestAuthenticator.h:128
DigestAuthenticator
Implements Digest Authentication.
Definition: DigestAuthenticator.h:55
DigestAuthenticator::setAutHeader
static void setAutHeader(const char *realm, HttpResponse *response)
Sets a HTTP digest authenticate header and sets status to.
Definition: DigestAuthenticator.h:125
HttpResponse
This object is used when sending response messages back to the client.
Definition: HttpServer.h:1194
UserIntf
Interface class used by the Authentication classes.
Definition: AuthenticatedUser.h:174
AuthenticatorIntf
Abstract interface class implemented by DigestAuthenticator, FormAuthenticator and DigestAuthenticato...
Definition: AuthenticatedUser.h:394