Among Friends

…a collection of demonstration apps using Friend, an authentication and authorization library for securing Clojure web services and applications.

Implementing authentication and authorization for your web apps is generally a necessary but not particularly pleasant task, even if you are using Clojure. Friend makes it relatively easy and relatively painless, but I thought the examples that the project's documentation demanded deserved a better forum than to bit-rot in a markdown file or somesuch. So, what better than a bunch of live demos of each authentication workflow that Friend supports (or is available via another library that builds on top of Friend), with smatterings of authorization examples here and there, all with links to the generally-less-than-10-lines of code that makes it happen? Check out the demos, find the one(s) that apply to your situation, and click the button on the right to go straight to the source for that demo:


  1. HTTP Basic — Using HTTP Basic to authenticate to a Ring app
  2. HTTP Basic requiring SSL — Same as 'HTTP Basic', but with the added condition that HTTPS/SSL is used (suitable for web service APIs).
  3. Interactive form — Typical username/password authentication + logout + a pinch of authorization functionality
  4. Multi-factor auth — Multi-factor Ring app authentication
  5. GitHub using OAuth2 — Authenticating via GitHub using OAuth2 [EXPERIMENTAL]
  6. #{Google, Yahoo, AOL, Wordpress, +} via OpenID — Using OpenID to authenticate with various services.
  7. Sign-up and redirect — Form-based all-in-one sign-up and redirect to authenticated space.


All demo applications here that directly require user-provided credentials recognize two different username/password combinations: