Skip to content

Commit f414d32

Browse files
committed
Described functionality of AuthOpenIDSingleIdP, AuthOpenIDAXRequire, AuthOpenIDAXUsername, AuthOpenIDSecureCookie
1 parent 9abe720 commit f414d32

1 file changed

Lines changed: 51 additions & 2 deletions

File tree

README.markdown

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ privieges on (see the docs for the AuthOpenIDDBLocation directive on the homepag
2929
# Usage
3030
In either a Directory, Location, or File directive in httpd.conf, place the following directive:
3131

32-
AuthType OpenID
33-
requre valid-user
32+
AuthType OpenID
33+
Require valid-user
3434

3535
There are also additional, optional directives. See the homepage for a list and docs.
3636

@@ -39,3 +39,52 @@ authentication.
3939

4040
See [the project page](http://findingscience.com/mod_auth_openid) for more information.
4141

42+
# New features in this fork
43+
44+
I wanted to make mod_auth_openid more useful to sites using
45+
[Google Apps OpenID](https://developers.google.com/accounts/docs/OpenID).
46+
47+
## AuthOpenIDSingleIdP
48+
In general, OpenID users can directly enter the identity they want to claim, or they can enter the identity
49+
of their provider, and then the provider can show some UI for choosing an identity to claim. If your site
50+
only allows a single provider, as will be the case if you're using Google's OpenID for authenticating users to
51+
internal sites, use the `AuthOpenIDSingleIdP <provider URL>` directive to preset it and mod_auth_openid will skip
52+
the login form entirely. Your users won't need to remember Google's OpenID provider identity, and they'll have
53+
less clicking to do.
54+
55+
AuthOpenIDSingleIdP https://www.google.com/accounts/o8/id # use Google's OpenID
56+
57+
## AuthOpenIDAXRequire
58+
When you claim an OpenID through Google's IdP, the returned OpenID looks like
59+
`https://www.google.com/accounts/o8/id?id=ABig4324Blob_ofLetters90_8And43Numbers`, which doesn't tell you
60+
which Google Apps domain they logged in from. If you want to find out who a user is for authorization purposes,
61+
you need to use the [Attribute Exchange (AX) extension to OpenID](http://openid.net/specs/openid-attribute-exchange-1_0.html)
62+
to ask the IdP for something you can check against. In the case of Google Apps, you can get their Apps username and
63+
domain by requesting their email address. The `AuthOpenIDAXRequire <alias> <URI> <regex>` lets you require
64+
[some attributes identified by URIs](http://openid.net/specs/openid-attribute-properties-list-1_0-01.html)
65+
to be returned with an OpenID response, and then validate the returned attribute against a regex. If the attribute
66+
isn't returned with the response, or if it doesn't match the regex, validation fails. You can have more than one
67+
`AuthOpenIDAXRequire` directive; all must pass for successful authentication.
68+
69+
AuthOpenIDAXRequire email http://axschema.org/contact/email @example\.com$ # users from example.com Apps domain only
70+
71+
## AuthOpenIDAXUsername
72+
As noted above, OpenIDs are not required to be pretty or even readable. You can use `AuthOpenIDAXUsername <alias>`
73+
to set Apache's `REMOTE_USER` variable to the AX attribute with that alias. This is what shows up in log files,
74+
and it's also accessible to whatever application you're wrapping with OpenID authentication.
75+
76+
AuthOpenIDAXUsername email # username is email address
77+
78+
## AuthOpenIDSecureCookie
79+
80+
`AuthOpenIDSecureCookie <On|Off>` controls whether the `Secure` attribute is set on your session cookies. If you're not using
81+
HTTPS for protecting authentication information in transit (ideally for *everything*), you're doing it wrong, so I was tempted
82+
to make this feature always on. However, sometimes I'm too lazy to set up SSL/TLS on local-only development boxes.
83+
84+
AuthOpenIDSecureCookie On # always for production sites!
85+
86+
## HttpOnly attribute set on session cookies
87+
88+
[There is no reason that your session cookie should be accessible from JavaScript.](https://www.owasp.org/index.php/HttpOnly)
89+
`HttpOnly` is now always set on your session cookies.
90+

0 commit comments

Comments
 (0)