Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
AuthenticatedUser.h
Go to the documentation of this file.
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 *
11 ****************************************************************************
12 * HEADER
13 *
14 * $Id: AuthenticatedUser.h 5978 2026-09-11 16:13:48Z wini $
15 *
16 * COPYRIGHT: Real Time Logic LLC, 2006 - 2023
17 *
18 * This software is copyrighted by and is the sole property of Real
19 * Time Logic LLC. All rights, title, ownership, or other interests in
20 * the software remain the property of Real Time Logic LLC. This
21 * software may only be used in accordance with the terms and
22 * conditions stipulated in the corresponding license agreement under
23 * which the software has been supplied. Any unauthorized use,
24 * duplication, transmission, distribution, or disclosure of this
25 * software is expressly forbidden.
26 *
27 * This Copyright notice may not be removed or modified without prior
28 * written consent of Real Time Logic LLC.
29 *
30 * Real Time Logic LLC. reserves the right to modify this software
31 * without notice.
32 *
33 * http://www.realtimelogic.com
34 ****************************************************************************
35 *
36 *
37 */
40#ifndef __AuthenticatedUser_h
41#define __AuthenticatedUser_h
42
43#include <HttpServer.h>
44#include <BaServerLib.h>
45#include <DoubleList.h>
46#include <SplayTree.h>
47
48#ifndef __DOXYGEN__
50struct UserIntf;
51struct AuthorizerIntf;
53struct LoginRespIntf;
54struct LoginTracker;
55struct LoginTrackerIntf;
56struct LoginTrackerNode;
57struct AuthInfo;
58#endif
59
60
61#ifdef __cplusplus
62extern "C" {
63#endif
64extern const char BasicAuthUser_derivedType[];
65extern const char DigestAuthUser_derivedType[];
66extern const char FormAuthUser_derivedType[];
67#ifdef __cplusplus
68}
69#endif
70
71
84typedef enum {
85 AuthenticatedUserType_Unknown,
86 AuthenticatedUserType_Digest,
87 AuthenticatedUserType_Basic,
88 AuthenticatedUserType_Form
90
91
106 struct AuthorizerIntf* intf,
107 struct AuthenticatedUser* user,
108 HttpMethod httpMethod,
109 const char* path);
110
114typedef struct AuthorizerIntf
115{
116#ifdef __cplusplus
118
123
130 bool authorize(struct AuthenticatedUser* user,
131 HttpMethod method,
132 const char* path);
133#endif
134 AuthorizerIntf_Authorize authorizeFP;
136
141#define AuthorizerIntf_constructor(o, authorize) (o)->authorizeFP=authorize
145#define AuthorizerIntf_authorize(o, user, method, path) \
146 (o)->authorizeFP(o, user, method, path)
147
148#ifdef __cplusplus
149inline
150AuthorizerIntf::AuthorizerIntf(AuthorizerIntf_Authorize authorize) {
152inline bool
154 HttpMethod method,
155 const char* path) {
156 return AuthorizerIntf_authorize(this,user,method,path) ? true : false; }
157#endif
158
159
188typedef void (*UserIntf_GetPwd)(struct UserIntf* intf,struct AuthInfo* info);
189
194typedef struct UserIntf
195{
196#ifdef __cplusplus
197
198 UserIntf() {}
199
204
205#endif
206 UserIntf_GetPwd getPwdFp;
208
209#ifdef __cplusplus
210extern "C" {
211#endif
212
217#define UserIntf_constructor(o, getPwd) (o)->getPwdFp = getPwd
218
223#define UserIntf_getPwd(o, username) (o)->getPwdFp(o, username)
224#ifdef __cplusplus
225}
226inline UserIntf::UserIntf(
227 UserIntf_GetPwd getPwd) {
228 UserIntf_constructor(this, getPwd);
229}
230#endif
231
232
233#ifndef __DOXYGEN__
234typedef struct AuthUserList
235{
236#ifdef __cplusplus
237#endif
238 SplayTreeNode super; /* inherits from SplayTreeNode */
239 DoubleList list; /* List of AuthenticatedUser objects */
240 struct UserIntf* userDb;
241 HttpServer* server;
242 char* username;
243 char* password;
244 int listLen; /* Number of objects in 'list' */
245} AuthUserList;
246#endif
247
248BA_API int AuthUserList_createOrCheck(struct AuthInfo* info,
249 UserIntf* userDb,
250 void** ptr,
251 size_t size);
252
253
254typedef DoubleListEnumerator AuthUserListEnumerator;
255#define AuthUserListEnumerator_constructor(e, o) \
256 DoubleListEnumerator_constructor(e, &(o)->list)
257BA_API struct AuthenticatedUser*
258AuthUserListEnumerator_getElement(DoubleListEnumerator* o);
259BA_API struct AuthenticatedUser*
260AuthUserListEnumerator_nextElement(DoubleListEnumerator* o);
261void AuthUserList_termIfEmpty(AuthUserList* o);
262
263
264
271typedef struct AuthenticatedUser
272{
273#ifdef __cplusplus
274
281 static AuthenticatedUser* get(HttpRequest* request);
282
283
289 static AuthenticatedUser* get(HttpSession* session);
290
296
302 const char* getPassword();
303
308 const char* getName();
309
322 void logout(bool all=false);
323
329
335#endif
336 HttpSessionAttribute superClass; /*as if inherited */
337 DoubleLink dlink; /* In AuthUserList */
338 AuthUserList* authUserList;
339 const char* derivedType; /* Used for dynamic cast */
341
342#ifdef __cplusplus
343extern "C" {
344#endif
345
346BA_API void
347AuthenticatedUser_constructor(AuthenticatedUser* o,
348 const char* derivedType,
349 AuthUserList* list,
351BA_API void AuthenticatedUser_destructor(AuthenticatedUser* o);
361#define AuthenticatedUser_getName(o) \
362 ((o) && (o)->authUserList && (o)->authUserList->username ? \
363 (o)->authUserList->username : 0)
364#define AuthenticatedUser_getDerivedType(o) (o)->derivedType
368#define AuthenticatedUser_getSession(o) \
369 HttpSessionAttribute_getSession((HttpSessionAttribute*)o)
373#define AuthenticatedUser_getPassword(o) \
374 ((o) && (o)->authUserList && (o)->authUserList->password ? \
375 (o)->authUserList->password : 0)
387#ifdef __cplusplus
388}
390 return AuthenticatedUser_get1(request); }
392 return AuthenticatedUser_get2(session); }
393inline const char* AuthenticatedUser::getName() {
394 return AuthenticatedUser_getName(this); }
396 return AuthenticatedUser_getSession(this); }
397inline const char* AuthenticatedUser::getPassword() {
398 return AuthenticatedUser_getPassword(this); }
399inline void AuthenticatedUser::logout(bool all) {
400 AuthenticatedUser_logout(this, all ? TRUE : FALSE); }
402 return AuthenticatedUser_getType(this); }
405#endif
406
415typedef AuthenticatedUser* (*AuthenticatorIntf_Authenticate)(
416 struct AuthenticatorIntf* super,
417 const char* relPath,
418 HttpCommand* cmd);
419
420
424typedef struct AuthenticatorIntf
425{
426#ifdef __cplusplus
427 /*Only to be used as default constructor when sub-classing with C code*/
429
434
441 AuthenticatedUser* authenticate(const char* relPath, HttpCommand* cmd);
442#endif
443 AuthenticatorIntf_Authenticate authenticateCB;
445
446#ifdef __cplusplus
447extern "C" {
448#endif
449
453#define AuthenticatorIntf_authenticate(o, relPath, cmd) \
454 (o)->authenticateCB(o, relPath, cmd)
455
462 AuthenticatorIntf_Authenticate authenticate);
463#ifdef __cplusplus
464}
465inline AuthenticatorIntf::AuthenticatorIntf(
466 AuthenticatorIntf_Authenticate authenticate) {
468}
470 const char* relPath, HttpCommand* cmd) {
471 return AuthenticatorIntf_authenticate(this, relPath, cmd);
472}
473#endif
474
475
492typedef void (*LoginRespIntf_Service)(struct LoginRespIntf* intf,
493 struct AuthInfo* info);
494
503typedef struct LoginRespIntf
504{
505#ifdef __cplusplus
506 LoginRespIntf() {}
511#endif
512 LoginRespIntf_Service serviceFp;
514
519#define LoginRespIntf_constructor(o, service) (o)->serviceFp=service
520#ifdef __cplusplus
521inline LoginRespIntf::LoginRespIntf(LoginRespIntf_Service service) {
522 LoginRespIntf_constructor(this, service); }
523#endif
524
525
529typedef enum {
540
546
547
552typedef struct AuthInfo
553{
556
559
561 const char* username;
562
564 const char* upwd;
565
568
571
574
576 void* userObj;
577
578 AuthUserList* authUserList;
579
589
590 U32 seed;
591 U32 seedKey;
592
595
598
601
604
608
616#define AuthInfo_constructor(o, trackerMA, cmdMA, typeMA) do {\
617 memset(o, 0, sizeof(AuthInfo));\
618 (o)->tracker=trackerMA;\
619 (o)->cmd=cmdMA;\
620 (o)->type=typeMA;\
621 (o)->maxUsers=3;\
622 (o)->ct=AuthInfoCT_Password;\
623 (o)->password[0]=0;\
624} while(0)
625
641 struct LoginTrackerIntf* o,
642 AuthInfo* info,
643 struct LoginTrackerNode* node);
644
645
655 struct LoginTrackerIntf* o,
656 AuthInfo* info,
657 struct LoginTrackerNode* node);
658
677 struct LoginTrackerIntf* o,
678 AuthInfo* info,
679 struct LoginTrackerNode* node);
680
693 struct LoginTrackerIntf* o,
694 struct LoginTrackerNode* node);
695
696
701typedef struct LoginTrackerIntf
702{
703#ifdef __cplusplus
713 LoginTrackerIntf_TerminateNode terminateNode);
714#endif
718 LoginTrackerIntf_TerminateNode terminateNode;
720
728#define LoginTrackerIntf_constructor(\
729 o, validateMA, loginMA, loginFailedMA, terminateNodeMA) do {\
730 (o)->validate=validateMA;\
731 (o)->login=loginMA;\
732 (o)->loginFailed=loginFailedMA;\
733 (o)->terminateNode=terminateNodeMA;\
734} while(0)
741#define LoginTrackerIntf_validate(o, request, node) \
742 (o)->validate(o, request, node)
748#define LoginTrackerIntf_login(o, request, user) \
749 (o)->login(o, request, user)
755#define LoginTrackerIntf_loginFailed(o, node, loginName) \
756 (o)->loginFailed(o, node, loginName)
761#define LoginTrackerIntf_terminateNode(o, node) \
762 (o)->terminateNode(o, node)
763
764#ifdef __cplusplus
769 LoginTrackerIntf_TerminateNode terminateNode) {
770 LoginTrackerIntf_constructor(this,validate,login,loginFailed,terminateNode);
771}
772#endif
773
774
779typedef struct LoginTrackerNode
780{
781#ifdef __cplusplus
785 U32 getCounter();
786
791
795 void setAuxCounter(U32 count);
796
800 HttpSockaddr* getAddr();
801
805 void setUserData(void* data);
806
810 void* getUserData();
811
815 BaTime getTime();
816#endif
817 SplayTreeNode super;
818 DoubleLink dlink;
819 HttpSockaddr addr;
820 void* userData;
821 BaTime t;
822 U32 loginCounter;
823 U32 auxCounter;
825
829#define LoginTrackerNode_getCounter(o) (o)->loginCounter
833#define LoginTrackerNode_getAuxCounter(o) (o)->auxCounter
837#define LoginTrackerNode_setAuxCounter(o, count) (o)->auxCounter=count
841#define LoginTrackerNode_getAddr(o) (&(o)->addr)
845#define LoginTrackerNode_setUserData(o, data) (o)->userData=data
849#define LoginTrackerNode_getUserData(o) (o)->userData
853#define LoginTrackerNode_getTime(o) (o)->t
854
855#ifdef __cplusplus
857 return LoginTrackerNode_getCounter(this);
858}
861}
862
865}
866
867inline HttpSockaddr* LoginTrackerNode::getAddr() {
868 return LoginTrackerNode_getAddr(this);
869}
870inline void LoginTrackerNode::setUserData(void* data) {
872}
874 return LoginTrackerNode_getUserData(this);
875}
877 return LoginTrackerNode_getTime(this);
878}
879#endif
880
890typedef struct LoginTracker
891{
892#ifdef __cplusplus
905 LoginTracker(U32 noOfLoginTrackerNodes,
906 LoginTrackerIntf* intf,
908
913 void clearCache();
914
920
926
932#endif
933 SplayTree tree;
934 DoubleList dInUseList;
935 DoubleList dFreeList;
936 LoginTrackerIntf* loginTrackerIntf;
937 U32 cursor;
938 U32 noOfLoginTrackerNodes;
939 LoginTrackerNode* nodes;
941
942
943#ifdef __cplusplus
944extern "C" {
945#endif
950 U32 noOfLoginTrackerNodes,
951 LoginTrackerIntf* intf,
952 AllocatorIntf* allocator);
983 LoginTracker* o, AuthInfo* info);
999#ifdef __cplusplus
1000}
1001inline LoginTracker::LoginTracker(U32 noOfLoginTrackerNodes,
1002 LoginTrackerIntf* intf,
1003 AllocatorIntf* allocator) {
1004 LoginTracker_constructor(this, noOfLoginTrackerNodes, intf, allocator);
1005}
1008}
1010 return LoginTracker_getFirstNode(this);
1011}
1013 return LoginTracker_getNextNode(this,n);
1014}
1016 return LoginTracker_find(this,request);
1017}
1018#endif
1019
1020 /* end of Authentication */
1022
1023/* Internal func */
1024void calculateHA1Hex(
1025 const char* realm, const char* uname, const char* pwd, U8 hexbuf[33]);
1026
1027#endif
#define UserIntf_constructor(o, getPwd)
Install the callback used by UserIntf.
Definition: AuthenticatedUser.h:217
struct UserIntf UserIntf
User database interface used by the authentication classes.
AuthInfoCT
AuthInfo Credential Type can optionally be used by the UserIntf_GetPwd callback function.
Definition: AuthenticatedUser.h:529
LoginTrackerNode * find(HttpRequest *request)
Find a cached address using the current connection's peer IP.
Definition: AuthenticatedUser.h:1015
BA_API void LoginTracker_loginFailed(LoginTracker *o, AuthInfo *info)
Record a failed login, inserting or recycling an address node as needed.
#define LoginTrackerIntf_constructor(o, validateMA, loginMA, loginFailedMA, terminateNodeMA)
Install required tracker callbacks; no callback may be NULL.
Definition: AuthenticatedUser.h:728
HttpSession * getSession()
Get the containing session.
Definition: AuthenticatedUser.h:395
static AuthenticatedUser * getAnonymous()
Access the shared anonymous user.
Definition: AuthenticatedUser.h:403
bool authorize(struct AuthenticatedUser *user, HttpMethod method, const char *path)
Returns TRUE if user is authorized.
Definition: AuthenticatedUser.h:153
BA_API void AuthenticatedUser_logout(AuthenticatedUser *o, BaBool all)
Log out and terminate the associated session or sessions.
#define LoginTrackerNode_getAddr(o)
Access the cached peer IP address.
Definition: AuthenticatedUser.h:841
const char * getPassword()
Access the stored credential representation.
Definition: AuthenticatedUser.h:397
AuthenticatedUser *(* AuthenticatorIntf_Authenticate)(struct AuthenticatorIntf *super, const char *relPath, HttpCommand *cmd)
The authenticator callback method for the abstract class AuthenticatorIntf.
Definition: AuthenticatedUser.h:415
U32 getCounter()
Query the address failure/denial counter.
Definition: AuthenticatedUser.h:856
LoginTrackerIntf(LoginTrackerIntf_Validate validate, LoginTrackerIntf_Login login, LoginTrackerIntf_LoginFailed loginFailed, LoginTrackerIntf_TerminateNode terminateNode)
Install four required callbacks; none may be NULL.
Definition: AuthenticatedUser.h:765
BA_API LoginTrackerNode * LoginTracker_getNextNode(LoginTracker *o, LoginTrackerNode *n)
Advance through active cached addresses.
void(* LoginTrackerIntf_Login)(struct LoginTrackerIntf *o, AuthInfo *info, struct LoginTrackerNode *node)
Prototype for the Login tracker method.
Definition: AuthenticatedUser.h:654
BaTime getTime()
Query the latest recorded failed or denied attempt.
Definition: AuthenticatedUser.h:876
BA_API AuthenticatedUser * AuthenticatedUser_get2(HttpSession *session)
Find the authenticated-user session attribute.
#define LoginTrackerNode_getUserData(o)
Query application data.
Definition: AuthenticatedUser.h:849
struct AuthorizerIntf AuthorizerIntf
An abstract class, which you must implement, provides a method of authorizing an authenticated user.
LoginTrackerNode * getNextNode(LoginTrackerNode *n)
Advance through active cached addresses.
Definition: AuthenticatedUser.h:1012
#define AuthenticatorIntf_authenticate(o, relPath, cmd)
Authenticate the user.
Definition: AuthenticatedUser.h:453
void * getUserData()
Query application data.
Definition: AuthenticatedUser.h:873
AuthenticatedUserType getType()
Identify the authenticator that created this user.
Definition: AuthenticatedUser.h:401
struct AuthenticatorIntf AuthenticatorIntf
Abstract interface class implemented by DigestAuthenticator, FormAuthenticator and BasicAuthenticator...
BaBool(* LoginTrackerIntf_Validate)(struct LoginTrackerIntf *o, AuthInfo *info, struct LoginTrackerNode *node)
Prototype for the validate callback method.
Definition: AuthenticatedUser.h:640
AuthenticatedUser * authenticate(const char *relPath, HttpCommand *cmd)
Authenticate the user.
Definition: AuthenticatedUser.h:469
struct LoginTrackerNode LoginTrackerNode
A LoginTrackerNode keeps track of how many times a user using a specific IP address has attempted to ...
BA_API BaBool LoginTracker_validate(LoginTracker *o, AuthInfo *info)
Check whether a cached peer may attempt authentication.
BA_API void LoginTracker_login(LoginTracker *o, AuthInfo *info)
Notify successful authentication and remove any cached peer entry.
BA_API AuthenticatedUser * AuthenticatedUser_get1(HttpRequest *request)
Find the authenticated user without creating a session.
const char * getName()
Access the authenticated name.
Definition: AuthenticatedUser.h:393
#define LoginRespIntf_constructor(o, service)
Install the callback used by LoginRespIntf.
Definition: AuthenticatedUser.h:519
BA_API void LoginTracker_destructor(LoginTracker *o)
Release a tracker after detaching all users.
LoginTrackerNode * getFirstNode()
Start iteration over active cached addresses in insertion order.
Definition: AuthenticatedUser.h:1009
#define AuthenticatedUser_getSession(o)
Get the containing session.
Definition: AuthenticatedUser.h:368
#define LoginTrackerNode_getAuxCounter(o)
Query the application auxiliary counter.
Definition: AuthenticatedUser.h:833
AuthenticatedUserType
The authenticator types.
Definition: AuthenticatedUser.h:84
struct LoginRespIntf LoginRespIntf
The LoginRespIntf is an abstract class, which must be implemented when using one of DigestAuthenticat...
#define LoginTrackerNode_getCounter(o)
Query the address failure/denial counter.
Definition: AuthenticatedUser.h:829
void logout(bool all=false)
Log out and terminate the associated session or sessions.
Definition: AuthenticatedUser.h:399
struct LoginTrackerIntf LoginTrackerIntf
The interface between the LoginTracker and the application code.
void(* LoginRespIntf_Service)(struct LoginRespIntf *intf, struct AuthInfo *info)
This callback function is called if the user failed to authenticate with one of DigestAuthenticator,...
Definition: AuthenticatedUser.h:492
void(* UserIntf_GetPwd)(struct UserIntf *intf, struct AuthInfo *info)
User database callback used by authenticators.
Definition: AuthenticatedUser.h:188
static AuthenticatedUser * get(HttpRequest *request)
Find the authenticated user without creating a session.
Definition: AuthenticatedUser.h:389
#define AuthorizerIntf_constructor(o, authorize)
Install the callback used by AuthorizerIntf.
Definition: AuthenticatedUser.h:141
void setUserData(void *data)
Associate application data with the node.
Definition: AuthenticatedUser.h:870
void clearCache()
Remove all active cached addresses.
Definition: AuthenticatedUser.h:1006
struct LoginTracker LoginTracker
The LoginTracker class is an optional security enhancement that can be installed in an instance of on...
BA_API LoginTrackerNode * LoginTracker_getFirstNode(LoginTracker *o)
Start iteration over active cached addresses in insertion order.
void(* LoginTrackerIntf_LoginFailed)(struct LoginTrackerIntf *o, AuthInfo *info, struct LoginTrackerNode *node)
Prototype for the LoginFailed callback method.
Definition: AuthenticatedUser.h:676
BA_API AuthenticatedUser * AuthenticatedUser_getAnonymous(void)
Access the shared anonymous user.
#define LoginTrackerNode_getTime(o)
Query the latest recorded failed or denied attempt.
Definition: AuthenticatedUser.h:853
U32 getAuxCounter()
Query the application auxiliary counter.
Definition: AuthenticatedUser.h:859
struct AuthInfo AuthInfo
An instance of the AuthInfo struct is created on the stack in the Barracuda authenticators and is use...
BA_API AuthenticatedUserType AuthenticatedUser_getType(AuthenticatedUser *o)
Identify the authenticator that created this user.
HttpSockaddr * getAddr()
Access the cached peer IP address.
Definition: AuthenticatedUser.h:867
BaBool(* AuthorizerIntf_Authorize)(struct AuthorizerIntf *intf, struct AuthenticatedUser *user, HttpMethod httpMethod, const char *path)
Prototype for the Authorize callback method.
Definition: AuthenticatedUser.h:105
#define AuthenticatedUser_getPassword(o)
Access the stored credential representation.
Definition: AuthenticatedUser.h:373
struct AuthenticatedUser AuthenticatedUser
Abstract base class implemented by BasicAuthUser, FormAuthUser and DigestAuthUser.
#define AuthorizerIntf_authorize(o, user, method, path)
Returns TRUE if user is authorized.
Definition: AuthenticatedUser.h:145
BA_API void LoginTracker_clearCache(LoginTracker *o)
Remove all active cached addresses.
void(* LoginTrackerIntf_TerminateNode)(struct LoginTrackerIntf *o, struct LoginTrackerNode *node)
Prototype for the TerminateNode callback method.
Definition: AuthenticatedUser.h:692
#define AuthenticatedUser_getName(o)
Access the authenticated name.
Definition: AuthenticatedUser.h:361
void setAuxCounter(U32 count)
Set the application auxiliary counter.
Definition: AuthenticatedUser.h:863
#define LoginTrackerNode_setUserData(o, data)
Associate application data with the node.
Definition: AuthenticatedUser.h:845
#define LoginTrackerNode_setAuxCounter(o, count)
Set the application auxiliary counter.
Definition: AuthenticatedUser.h:837
BA_API void AuthenticatorIntf_constructor(AuthenticatorIntf *o, AuthenticatorIntf_Authenticate authenticate)
Install the callback used by AuthenticatorIntf.
BA_API LoginTrackerNode * LoginTracker_find(LoginTracker *o, HttpRequest *req)
C form of LoginTracker::find.
BA_API void LoginTracker_constructor(LoginTracker *o, U32 noOfLoginTrackerNodes, LoginTrackerIntf *intf, AllocatorIntf *allocator)
Allocate a fixed cache of address records.
LoginTracker(U32 noOfLoginTrackerNodes, LoginTrackerIntf *intf, AllocatorIntf *allocator=AllocatorIntf::getDefault())
Allocate a fixed cache of address records.
Definition: AuthenticatedUser.h:1001
@ AuthInfoCT_Invalid
Set when getpwd callback failed comparing AuthInfo::upwd with stored password.
Definition: AuthenticatedUser.h:544
@ AuthInfoCT_Valid
Set when getpwd callback successfully compared AuthInfo::upwd with stored password.
Definition: AuthenticatedUser.h:539
@ AuthInfoCT_HA1
The password is returned as a HA1 hash, which is: MD5(username ":" realm ":" password)
Definition: AuthenticatedUser.h:535
@ AuthInfoCT_Password
The default.
Definition: AuthenticatedUser.h:531
void(* HttpSessionAttribute_Destructor)(struct HttpSessionAttribute *o)
HttpSessionAttribute termination callback function.
Definition: HttpServer.h:2216
HttpMethod
HTTP method types.
Definition: HttpServer.h:910
S64 BaTime
An arithmetic type representing calendar time with epoch of 1970-01-01 00:00:00 UTC,...
Definition: GenPrimT.h:103
uint32_t U32
Unsigned 32-bit integer.
Definition: GenPrimT.h:93
uint8_t U8
Unsigned 8-bit integer.
Definition: GenPrimT.h:89
U8 BaBool
Boolean stored in an unsigned byte; FALSE is zero and TRUE is one.
Definition: GenPrimT.h:118
Memory allocation and deallocation Interface class.
Definition: AllocatorIntf.h:98
static AllocatorIntf * getDefault(void)
Obtain the shared allocator backed by baMalloc, baRealloc and baFree.
Definition: AllocatorIntf.h:200
An instance of the AuthInfo struct is created on the stack in the Barracuda authenticators and is use...
Definition: AuthenticatedUser.h:553
const char * username
Borrowed NUL-terminated input user name, or NULL when no login was supplied.
Definition: AuthenticatedUser.h:561
const char * upwd
Borrowed supplied password when available for Basic/Form; NULL when unavailable, including Digest.
Definition: AuthenticatedUser.h:564
AuthInfoCT ct
Credential interpretation selected by UserIntf_GetPwd.
Definition: AuthenticatedUser.h:573
BaBool recycle
Initially FALSE.
Definition: AuthenticatedUser.h:603
int maxUsers
Maximum concurrent logins for the user; initially 3.
Definition: AuthenticatedUser.h:594
struct LoginTracker * tracker
Borrowed optional tracker; NULL when tracking is disabled.
Definition: AuthenticatedUser.h:555
U8 password[100]
Output credential storage, initially empty.
Definition: AuthenticatedUser.h:606
BaTime maxInactiveInterval
This variable specifies the time, in seconds, between client requests before the user is automaticall...
Definition: AuthenticatedUser.h:588
HttpCommand * cmd
Borrowed command for normal authentication.
Definition: AuthenticatedUser.h:558
AuthenticatedUser * user
Borrowed authenticated user when available, otherwise NULL.
Definition: AuthenticatedUser.h:567
int loginAttempts
Tracker-derived login counter difference when access is denied; initially zero.
Definition: AuthenticatedUser.h:597
BaBool denied
Initially FALSE; set TRUE when the tracker validation callback denies a cached address.
Definition: AuthenticatedUser.h:600
void * userObj
Application pointer shared between callbacks in this authentication flow; initially NULL.
Definition: AuthenticatedUser.h:576
AuthenticatedUserType type
Input authentication mechanism; Unknown is permitted for direct database lookup.
Definition: AuthenticatedUser.h:570
Abstract base class implemented by BasicAuthUser, FormAuthUser and DigestAuthUser.
Definition: AuthenticatedUser.h:272
Abstract interface class implemented by DigestAuthenticator, FormAuthenticator and BasicAuthenticator...
Definition: AuthenticatedUser.h:425
An abstract class, which you must implement, provides a method of authorizing an authenticated user.
Definition: AuthenticatedUser.h:115
The HttpCommand class is a container class for the HttpRequest and HttpResponse command pair.
Definition: HttpServer.h:2151
The HttpServer creates an HttpRequest object when the HttpServer parses a client request.
Definition: HttpServer.h:950
The Web Server.
Definition: HttpServer.h:3393
The interface to an HttpSession attribute.
Definition: HttpServer.h:2247
Provides a way to identify a user across more than one page request or visit to a web site,...
Definition: HttpServer.h:2305
The LoginRespIntf is an abstract class, which must be implemented when using one of DigestAuthenticat...
Definition: AuthenticatedUser.h:504
The interface between the LoginTracker and the application code.
Definition: AuthenticatedUser.h:702
A LoginTrackerNode keeps track of how many times a user using a specific IP address has attempted to ...
Definition: AuthenticatedUser.h:780
The LoginTracker class is an optional security enhancement that can be installed in an instance of on...
Definition: AuthenticatedUser.h:891
Intrusive tree node.
Definition: SplayTree.h:52
Self-adjusting tree of caller-owned nodes, with unique keys.
Definition: SplayTree.h:109
User database interface used by the authentication classes.
Definition: AuthenticatedUser.h:195