Liking cljdoc? Tell your friends :D

buddy-auth

Authentication and authorization for Ring web applications.

Clojars Project cljdoc test

Stack

Clojure Ring buddy-sign

What

buddy-auth provides pluggable authentication and authorization for Ring and Ring-based web applications:

  • Authentication backends: HTTP Basic, session, and token. Token covers signed JWT and JWE through buddy-sign, and JWKS/OIDC token validation through jose-clj.
  • Ring middleware: wrap-authentication / wrap-authorization.
  • Access rules: declarative authorization for each route with clout patterns.

Installation

deps.edn:

net.clojars.savya/buddy-auth {:mvn/version "4.0.2"}

Leiningen:

[net.clojars.savya/buddy-auth "4.0.2"]

Usage

(require '[buddy.auth :refer [authenticated?]]
         '[buddy.auth.backends :as backends]
         '[buddy.auth.middleware :refer [wrap-authentication]])

(def backend (backends/basic {:authfn my-authfn}))

(def app
  (-> handler
      (wrap-authentication backend)))

Full guide: cljdoc and doc/user-guide.md.

Maintenance fork

This is a maintenance fork of funcool/buddy-auth. The README of that project said it was in maintenance mode and needed a new maintainer. This fork uses current buddy-sign and tools.build. It runs CI on Clojure 1.11 and 1.12. It is published as net.clojars.savya/buddy-auth. Andrey Antukh and contributors did the original work.

License

Copyright © 2013-2022 Andrey Antukh.

Maintenance fork (2026) by Savyasachi, original: https://github.com/funcool/buddy-auth. Distributed under the Apache License 2.0, preserving the original license.

Can you improve this documentation? These fine people already did:
Savyasachi, Andrey Antukh & Josh Graham
Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close