chiark / gitweb /
fixes
[cgi-auth-flexible.git] / DESIGN
1 cookie
2   user assoc id
3
4 hidden form parameter
5   user assoc id
6
7 same or different ?
8
9 unused session expiry ?
10
11
12 logged in user associations database
13
14 user login details form
15
16 user authentication form
17
18 user is abstract ?
19   string suitable for database
20   not interpreted by session code
21
22
23
24 app needs to first check is it a login form submission
25 if so check details
26 if ok then call
27   create new login assoc(username)
28   which returns a cookie to set
29
30 check function
31   checks for assoc id in cookie and form
32   if assoc id in cookie and op is GET, allow
33   otherwise demand in form too
34   checks for timeout too of course
35
36 if failure, app must show login form
37
38 app needs to check for logout button submission
39   if so then call
40   delete this login
41     which mostly does what check does and then also deletes the
42     assoc and the cookie
43
44
45
46 ----------------------------------------
47
48 DECISONS
49 clearing cookies does log out?
50 no persistent cookie?
51 allow read-only post/get distinction?
52
53 does not support persistent cookie, as that needs two db entries etc.
54  two cookies complicated api
55
56 clearing cookies always logs out
57
58
59 ----------------------------------------
60
61 app supplies
62
63  - func to tell whether it's a login form,
64       defaults to password form field
65  - func to check login details
66  - func to tell whether it's a logout form,
67       defaults to logout action form field list
68  - func to tell whether it's programmatic
69       defaults to always false, somewhat poor EH
70
71 we supply
72
73  - thing to call right at the beginning,
74    tells app to divert to one of
75       just logged out page
76       cookies disabled page
77       stale form login form
78       login form
79       "session interrupted"
80       a redirect
81
82  - version of the above which deals with the request
83
84  - thing which app must call when mutating
85       (alternatively app must check that method is POST for mutates)
86       (alternatively.2 every GETs is decreed to produce a login form)