# `Sake.Client.Auth.Headless`
[🔗](https://github.com/hattoriai/sake/blob/v0.4.3/lib/sake/client/auth/headless.ex#L1)

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.

# `authorize`

```elixir
@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`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
