View Source Nimrag.Auth (Nimrag v0.1.0)

Unofficial authentication to Garmin's API.

It requires username, password, and may ask for MFA code if needed. See Nimrag.Credentials for more details on how to provide credentials.

It's using the same method for obtaining OAuth1 and OAuth2 tokens as the mobile app, and popular Python library garth.

This may break at any time as it's not using public API.

Garmin API is available only to business partners, so please don't abuse it in any way.

Summary

Functions

Link to this function

get_oauth1_token(client, ticket)

View Source
Link to this function

get_oauth2_token(client)

View Source
Link to this function

get_oauth2_token(client, oauth1_token)

View Source
@spec login_sso(Nimrag.Credentials.t()) ::
  {:ok, Nimrag.Client.t()} | {:error, String.t()}
@spec login_sso(Nimrag.Client.t()) :: {:ok, Nimrag.Client.t()} | {:error, String.t()}
Link to this function

login_sso(client, credentials)

View Source
@spec login_sso(Nimrag.Client.t(), Nimrag.Credentials.t()) ::
  {:ok, Nimrag.Client.t()} | {:error, String.t()}
Link to this function

maybe_refresh_oauth2_token(client, opts \\ [])

View Source