Authentication & Authorization
Secure your Clojure backend with token-based authentication and role-based authorization using Ring middleware.
AuthN vs AuthZ
Two distinct concerns:
- Authentication (AuthN): who are you?
- Authorization (AuthZ): what are you allowed to do?
You must verify identity before checking permissions.
Hashing Passwords
Never store plain passwords. Use a slow, salted hash like bcrypt via the buddy library.
(require '[buddy.hashers :as hashers])
(def stored (hashers/derive "secret123"))
(hashers/check "secret123" stored) ; => trueAll lessons in this course
- Building a RESTful API
- Event-Driven Architectures
- System Design & Scalability Patterns
- Authentication & Authorization