Strava v0.2.0 Strava.Auth

An OAuth2 strategy for Strava.

Summary

Functions

The authorization URL endpoint of the provider

Returns the authorize url based on the client configuration

Parse the detailed representation of the current athlete from the OAuth2 access token

Retrieve an access token given the specified validation code

Fetches an OAuth2.AccessToken struct by making a request to the token endpoint

Functions

authorize_url(client, params)

The authorization URL endpoint of the provider.

  • params additional query parameters for the URL
authorize_url!(params \\ [])

Returns the authorize url based on the client configuration.

  • approval_prompt: string optional "force" or "auto", use "force" to always show the authorization prompt even if the user has already authorized the current application, default is "auto"

  • scope: string optional comma delimited string of "view_private" and/or "write", leave blank for read-only permissions.

  • state: string optional returned to your application, useful if the authentication is done from various points in an app

get_athlete!(client)

Parse the detailed representation of the current athlete from the OAuth2 access token.

get_token(client, params, headers)

Retrieve an access token given the specified validation code.

get_token!(params \\ [], headers \\ [])

Fetches an OAuth2.AccessToken struct by making a request to the token endpoint.

Returns the OAuth2.Client struct loaded with the access token which can then be used to make authenticated requests to an OAuth2 provider's API.

You can pass options to the underlying http library via options parameter

new()