]> err.no Git - sope/blob - skyrix-sope/NGObjWeb/SoObjects/SoHTTPAuthenticator.h
added svn:keywords and svn:ignore where appropriate. removed CVS artifacts.
[sope] / skyrix-sope / NGObjWeb / SoObjects / SoHTTPAuthenticator.h
1 /*
2   Copyright (C) 2000-2003 SKYRIX Software AG
3
4   This file is part of OGo
5
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
9   later version.
10
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.
15
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
19   02111-1307, USA.
20 */
21 // $Id$
22
23 #ifndef __SoObjects_SoHTTPAuthenticator_H__
24 #define __SoObjects_SoHTTPAuthenticator_H__
25
26 #import <Foundation/NSObject.h>
27
28 /*
29   SoHTTPAuthenticator
30
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.
36 */
37
38 @class NSString, NSException, NSArray;
39 @class WOContext, WOResponse;
40 @class SoUser;
41
42 @interface SoHTTPAuthenticator : NSObject
43 {
44 }
45
46 /* password checker (override in subclasses !) */
47
48 - (BOOL)checkLogin:(NSString *)_login password:(NSString *)_pwd;
49
50 /* HTTP basic authentication */
51
52 - (NSString *)authRealm;
53 - (WOResponse *)preprocessCredentialsInContext:(WOContext *)_ctx;
54
55 - (NSString *)checkCredentials:(NSString *)_creds;
56 - (NSString *)checkCredentialsInContext:(WOContext *)_ctx;
57 - (NSArray *)parseCredentials:(NSString *)_creds;
58 + (NSArray *)parseCredentials:(NSString *)_creds;
59
60 /* user management */
61
62 - (SoUser *)userInContext:(WOContext *)_ctx;
63 - (NSArray *)rolesForLogin:(NSString *)_login;
64
65 /* render auth exceptions of SoSecurityManager */
66
67 - (BOOL)renderException:(NSException *)_e inContext:(WOContext *)_ctx;
68
69 @end
70
71 #endif /* __SoObjects_SoHTTPAuthenticator_H__ */