Barracuda Application Server C/C++ Reference
NO
BasicAuthenticator.h
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 ****************************************************************************
11 * HEADER
12 *
13 * $Id: BasicAuthenticator.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 __BasicAuthenticator_h
38#define __BasicAuthenticator_h
39
40#include <AuthenticatedUser.h>
41
51typedef struct BasicAuthenticator
52#ifdef __cplusplus
53: public AuthenticatorIntf
54{
62 BasicAuthenticator(UserIntf* userDbIntf,
63 const char* realm,
64 LoginRespIntf* sendLogin);
65
69 void setLoginTracker(LoginTracker* tracker);
70
75 static void setAutHeader(const char* realm, HttpResponse* response);
76
77#else
78{
79 AuthenticatorIntf superClass; /*as if inherited*/
80#endif
81 UserIntf* userDbIntf;
82 LoginTracker* tracker;
83 char* realm;
84 LoginRespIntf* sendLogin;
85 BaBool filterMsDomain; /* If remove MS domain name prefix */
87
88
89#ifdef __cplusplus
90extern "C" {
91#endif
92BA_API void BasicAuthenticator_constructor(
94 UserIntf* userDbIntf,
95 const char* realm,
96 LoginRespIntf* sendLogin);
97BA_API void BasicAuthenticator_destructor(BasicAuthenticator* o);
98#define BasicAuthenticator_setLoginTracker(o,loginTracker) \
99 (o)->tracker=loginTracker
100#define BasicAuthenticator_setFilterMsDomain(o, state) \
101 (o)->filterMsDomain=state
102BA_API void BasicAuthenticator_setAutHeader(
103 const char* realm,HttpResponse* resp);
104#ifdef __cplusplus
105}
106inline BasicAuthenticator::BasicAuthenticator(UserIntf* userDbIntf,
107 const char* realm,
108 LoginRespIntf* sendLogin) {
109 BasicAuthenticator_constructor(
110 this,userDbIntf,realm,sendLogin); }
112 BasicAuthenticator_setLoginTracker(this, tracker); }
114 const char* realm, HttpResponse* resp) {
115 BasicAuthenticator_setAutHeader(realm,resp); }
116#endif
117 /* end of Authentication */
119
120#endif
static void setAutHeader(const char *realm, HttpResponse *response)
Sets a HTTP basic authenticate header and sets status to.
Definition: BasicAuthenticator.h:113
void setLoginTracker(LoginTracker *tracker)
Prevent dictionary attacks.
Definition: BasicAuthenticator.h:111
Abstract interface class implemented by DigestAuthenticator, FormAuthenticator and DigestAuthenticato...
Definition: AuthenticatedUser.h:395
Implements Basic Authentication.
Definition: BasicAuthenticator.h:54
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