Sake.Client.Auth.Headless (Sake v0.4.3)

Copy Markdown View Source

Authorizes without a person: GETs the authorization URL, does not follow the redirect it answers with, and reads the authorization response from its Location header.

Sake.Client.connect(url, auth: [authorize: &Sake.Client.Auth.Headless.authorize/1])

Only for an authorization server that approves at once — a test server, the conformance suite's, or one that recognizes the caller from something passed in req: (a session cookie, say) — never for one that shows a login page or asks for consent.

Summary

Functions

Follows url once. The redirect must go to the request's own redirect_uri; its query parameters are the result. opts: req:, extra options for Req.get/2.

Functions

authorize(url, opts \\ [])

@spec authorize(String.t(), keyword()) :: {:ok, map()} | {:error, term()}

Follows url once. The redirect must go to the request's own redirect_uri; its query parameters are the result. opts: req:, extra options for Req.get/2.