2 Copyright (C) 2006 Helge Hess
4 This file is part of SOPE.
6 SOPE 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 SOPE 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 SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #ifndef __SoObjects_SoCookieAuthenticator_H__
23 #define __SoObjects_SoCookieAuthenticator_H__
25 #import <Foundation/NSObject.h>
30 SoCookieAuthenticator is an abstract base class for Cookie based
31 authentication. That is, it uses a Cookie to store the credentials
32 or a token of a session.
33 In the simplest case you only need to override -checkLogin:password:
34 to ensure login/password combinations.
36 NOTE: work in progress.
38 TODO: we also need a WOSessionAuthenticator which assumes that the
39 existance of a session implies a successful authentication?
42 @class NSString, NSException, NSArray;
43 @class WOContext, WOResponse, WOCookie;
46 @interface SoCookieAuthenticator : NSObject
50 /* password checker (override in subclasses !) */
52 - (BOOL)checkLogin:(NSString *)_login password:(NSString *)_pwd;
54 /* Cookie authentication */
56 - (NSString *)cookieNameInContext:(WOContext *)_ctx;
57 - (WOResponse *)preprocessCredentialsInContext:(WOContext *)_ctx;
59 - (NSString *)checkCredentialsInContext:(WOContext *)_ctx;
60 - (NSArray *)parseCredentials:(NSString *)_creds;
64 - (SoUser *)userInContext:(WOContext *)_ctx;
65 - (NSArray *)rolesForLogin:(NSString *)_login;
67 /* render auth exceptions of SoSecurityManager */
69 - (BOOL)renderException:(NSException *)_e inContext:(WOContext *)_ctx;
73 #endif /* __SoObjects_SoCookieAuthenticator_H__ */