# `Magpie.Auth.StaticToken`
[🔗](https://github.com/alexcassol/magpie/blob/v0.3.1/lib/magpie/auth/static_token.ex#L1)

`Magpie.Auth.TokenProvider` backed by a plain access token string.

This is what `Magpie.Client.new("ACCESS_TOKEN")` uses internally, so the
two forms below are equivalent:

    Magpie.Client.new("ACCESS_TOKEN")
    Magpie.Client.new(token_provider: {Magpie.Auth.StaticToken, "ACCESS_TOKEN"})

There is nothing to refresh here: `refresh_token/1` hands back the very
same token, so a Dropbox `expired_access_token` error propagates to the
caller as a regular `Magpie.Error`. Dropbox access tokens are short-lived
(~4 hours) — use `Magpie.Auth.TokenServer` for anything long-running.

# `fetch_token`

Returns the wrapped token.

    iex> Magpie.Auth.StaticToken.fetch_token("sl.ABC")
    {:ok, "sl.ABC"}

# `refresh_token`

Returns the wrapped token — a static token cannot be refreshed.

    iex> Magpie.Auth.StaticToken.refresh_token("sl.ABC")
    {:ok, "sl.ABC"}

---

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