https://github.com/codahale/u2f-clj
A library for implementing FIDO U2F multi-factor authentication.
https://github.com/codahale/u2f-clj
Last synced: 5 months ago
JSON representation
A library for implementing FIDO U2F multi-factor authentication.
- Host: GitHub
- URL: https://github.com/codahale/u2f-clj
- Owner: codahale
- License: epl-1.0
- Archived: true
- Created: 2016-12-06T23:57:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-07T00:03:19.000Z (over 9 years ago)
- Last Synced: 2025-10-22T00:02:40.582Z (5 months ago)
- Language: Clojure
- Size: 7.81 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# u2f-clj
A Clojure library for implementing FIDO U2F multi-factor authentication.
## Usage
```clojure
(require '[u2f-clj.core :as u2f])
;; create a challenge to register a new device
(def reg-challenge (u2f/start-registration "https://example.com/" []))
;; register a new device given a token response
(def device (u2f/finish-registration (:data reg-challenge) reg-response))
;; create a challenge to authenticate with a registered device
(def auth-challenge (u2f/start-authentication "https://example.com/" [device]))
;; verify a response from the token
(when (u2f/finish-authentication [device] (:data auth-challenge] auth-response))
(println "yay"))
```
## License
Copyright © 2016 Coda Hale
Distributed under the Eclipse Public License either version 1.0 or (at your
option) any later version.