2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #ifndef __SoObjects_SoHTTPAuthenticator_H__
24 #define __SoObjects_SoHTTPAuthenticator_H__
26 #import <Foundation/NSObject.h>
31 SoHTTPAuthenticator is an abstract base class for HTTP (basic
32 authentication) based user databases. It deals with all the encoding,
33 decoding of credentials.
34 In the simplest case you only need to override -checkLogin:password:
35 to ensure login/password combinations.
38 @class NSString, NSException, NSArray;
39 @class WOContext, WOResponse;
42 @interface SoHTTPAuthenticator : NSObject
46 /* password checker (override in subclasses !) */
48 - (BOOL)checkLogin:(NSString *)_login password:(NSString *)_pwd;
50 /* HTTP basic authentication */
52 - (NSString *)authRealm;
53 - (WOResponse *)preprocessCredentialsInContext:(WOContext *)_ctx;
55 - (NSString *)checkCredentials:(NSString *)_creds;
56 - (NSString *)checkCredentialsInContext:(WOContext *)_ctx;
57 - (NSArray *)parseCredentials:(NSString *)_creds;
58 + (NSArray *)parseCredentials:(NSString *)_creds;
62 - (SoUser *)userInContext:(WOContext *)_ctx;
63 - (NSArray *)rolesForLogin:(NSString *)_login;
65 /* render auth exceptions of SoSecurityManager */
67 - (BOOL)renderException:(NSException *)_e inContext:(WOContext *)_ctx;
71 #endif /* __SoObjects_SoHTTPAuthenticator_H__ */