]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/todo/separate_authentication_from_authorization.mdwn
4a602babff00e9a0946e1a427f1c458132f48de6
[git.ikiwiki.info.git] / doc / todo / separate_authentication_from_authorization.mdwn
1 [[plugins/openid]] and the new [[plugins/emailauth]] both assume that
2 the user's authentication identity (how they log in) is suitable as
3 an authorization identity (who they are when they have logged in). In
4 particular, the OpenID or email address goes into the git history.
6 Relatedly, I'm not sure I'd be comfortable with enabling [[plugins/emailauth]]
7 on my own sites while it writes users' email addresses into the git history:
8 non-technical people (and many technical people for that matter) get
9 possessive about who can know their email address. The usual expectation for
10 email addresses on websites seems to be that they will be used by the site
11 owner (and maybe their outsourced service providers), but not available
12 to random third parties. The principle of least astonishment would suggest
13 that we should do the same here.
15 (The expectation of privacy for direct git commits is rather different:
16 I think we can expect direct git committers to know that they
17 should either set a plausible non-email-address in their git identity,
18 like I used to use my OpenID, or have good spam filtering.)
20 If we present email-based users in the "web UI" using only the local-part
21 of their address, we also have a potentially confusing situation where
22 `chris@example.com` and `chris@other.example.net` both contribute to a wiki:
23 if I'm reading the code right, they'd both be presented as `chris`, with no
24 way to change that other than using a different email address?
26 Here is a sketch of a different account model that would address that:
28 * An account has a username, e.g. `smcv`. It normally matches some regexp that
29   includes neither @ nor / (to rule out collisions with email addresses
30   and OpenIDs).
32   * We currently allow qr{-[:alnum:]+/.:_} by default, so passwordauth
33     accounts can in principle collide with OpenIDs. That would probably be
34     worth fixing (for new account creation) anyway - I don't think we want
35     users with / in their names, which would make their user-page into a
36     subpage?
38 * If passwordauth is enabled, accounts may have a password. Users can
39   authenticate to an account that has a password by entering that password.
40   The username is always the account name (because there's little reason
41   to do anything else).
43 * If httpauth is enabled, anyone who can authenticate to the web server
44   automatically gets access to the account of the same name in the wiki.
45   (Or we could consider having a configurable map
46   { web-server-level username => wiki account } but the default would be
47   an identity mapping.)
49 * If OpenID is enabled, accounts may have an OpenID.
50   The owner of that OpenID can log in, and gets logged-in to that account.
51   Either reusing the same OpenID for multiple accounts is not allowed, or
52   if the same OpenID is attached to more than one account the user can choose
53   (as an extra step). Optionally, more than one OpenID could be allowed.
55 * If emailauth is enabled, accounts may have an email address.
56   Users can authenticate to an account that has an email
57   address (and is not a grandfathered OpenID) by using the token challenge.
58   (passwordauth accounts could already do a password-reset, so this is not
59   any less secure.)
61 * Creating an account from an email address (maybe also OpenID?) has a new
62   step: choosing a username, with some text about "this name will appear
63   in recentchanges and in the wiki's history". The default would be the
64   local-part (user) from the email address.
66 * Grandfathered OpenID support: every existing account that looks like an
67   OpenID has that OpenID associated with it, and it cannot be changed or
68   removed. The displayed form is openiduser().
70 * Grandfathered emailauth support, if required (but it might not be required
71   if we implement this model before the next ikiwiki release): every existing
72   account that looks like an email address has that email address associated
73   with it, and it cannot be changed or removed. The displayed form is
74   emailuser() but we should maybe change that to output something more
75   like `smcv@…`.
77 * Hypothetically, an account could also have a https client certificate
78   for a new client-certificate plugin, or a Google account for a new OAuth2
79   plugin, or whatever, and all of the above applies equally.
81 * Unlike the current OpenID support, if the user's authentication provider
82   goes away (or if Google stops doing OAuth2 and moves on to the next big
83   thing), they can associate a different authentication identity with
84   their existing wiki account, and continue.
86 This is basically the same model that Mozilla Persona encourages,
87 except using emailauth ourselves instead of outsourcing (the equivalent
88 of) that step to Mozilla.
90 Thoughts?
92 --[[smcv]]
94 > I always find it a little ackward that i have two different accounts on this wiki: one for OpenID, and the other (regular account) for email notifications (because of [[bugs/notifyemail_fails_with_some_openid_providers/]]). It seems to me those accounts should just be merged as one, ie. I was expecting to be able to choose a username when i registered with openid.
95
96 > Also, when you talk about "separating authentication from authorization", i immediately thought of [[todo/ACL/]] and [[todo/Zoned_ikiwiki/]], so i thought i could mention those... having stability in the usernames would help in the design of those... --[[anarcat]]