Skip to content

Latest commit

 

History

History
55 lines (40 loc) · 1.51 KB

CHANGELOG.org

File metadata and controls

55 lines (40 loc) · 1.51 KB

Changes

0.4.0

Add support for including custom query parameters in the authorisation URL.

(require '[oauth.two :refer :all])

(def client
  (make-client {:authorize-uri "https://provider.com/oauth/authorize"
                :redirect-uri "https://example.com/"
                :scopes #{"read"}}))

(authorization-url client
                   {:scopes #{"read" "write" "admin"}}
                   {:approval_prompt "auto"})

;; => https://provider.com/oauth/authorize?
;;     approval_prompt=auto&
;;     redirect_uri=https%3A%2F%2Fexample.com%2F&
;;     response_type=code

This is more of a convenience feature than anything else. You used to be able to append parameters to the end of the URL, but as it’s quite a common operation I’ve added support to the library.

0.3.0

Rename scopes to scope everywhere.

You’ll need to change the map you pass into make-client and/or authorization-url so that instead of passing :scopes you pass :scope.

Before:

(def client
  (make-client {:scopes #{"read"}}))

(authorization-url client {:scopes #{"read" "write" "admin"}})

And now:

(def client
  (make-client {:scope #{"read"}}))

(authorization-url client {:scope #{"read" "write" "admin"}})

0.2.0

Make useful schema like ClientConfig, AuthorizationParams, and TokenRequestParams public so they can be used in third-party code that wants to validate the boundary between them and us.