SyphtClient v0.1.1 SyphtClient.Auth View Source
Acquires and caches Sypht access tokens.
Configuration
Override these defaults in the :sypht_client section of your config.exs files.
auth_url: "https://login.sypht.com/oauth/token"- URL of token acquisition end pointauth_ttl: 84_600_000- Token TTL milliseconds. Sypht tokens last for 24 hours - reacquire after 23 hours 30 minutesauth_retry_on: [500]- Retry token acquisition on server HTTP statusauth_initial_backoff: 200- Initial backoff millisecondsauth_retry_until: 30_000- Continue backing off and retrying until this many milliseconds have elapsedauth_http_options: [ssl: [{:versions, [:"tlsv1.2"]}]]- Hackney HTTP options for authenticationauth_error_prefix: "SyphtAuth failed:"- Prefix authentication error messages with this
Link to this section Summary
Functions
Gets an access token using the client ID and secret in the environment variable SYPHT_API_KEY. Caches and subsequently returns any tokens acquired from Sypht for :auth_ttl milliseconds. Returns {:ok, sypht_bearer_token} if successful, {:error, reason_string} otherwise.
Link to this section Functions
Gets an access token using the client ID and secret in the environment variable SYPHT_API_KEY. Caches and subsequently returns any tokens acquired from Sypht for :auth_ttl milliseconds. Returns {:ok, sypht_bearer_token} if successful, {:error, reason_string} otherwise.