Module: Strava::Api::Endpoints::OAuth

Included in:
Client
Defined in:
lib/strava/api/endpoints/oauth.rb

Overview

API endpoints for OAuth operations.

OAuth endpoints provide functionality for managing OAuth access tokens, including the ability to revoke an athlete's access token and deauthorize an application's access to their data.

Instance Method Summary collapse

Instance Method Details

#deauthorize(options = {}) ⇒ Authorization

Deprecated.

Use #revoke instead. The oauth/deauthorize endpoint will be retired on June 1, 2027 in favor of the new oauth/revoke endpoint.

Revoke access to an athlete's data.

Deauthorizes the application and revokes the athlete's access token. After calling this method, the access token will no longer be valid and the athlete will need to reauthorize the application.

Examples:

Deauthorize the current athlete

client.deauthorize

Parameters:

  • options (Hash) (defaults to: {})

    Additional options for the deauthorization request

Returns:

  • (Authorization)

    Authorization response with revocation confirmation

See Also:



55
56
57
# File 'lib/strava/api/endpoints/oauth.rb', line 55

def deauthorize(options = {})
  Strava::Models::Authorization.new(post('deauthorize', { endpoint: Strava::OAuth.config.endpoint }.merge(options)))
end

#revoke(options = {}) ⇒ Authorization

Revoke access to an athlete's data.

Revokes the athlete's access token. After calling this method, the access token will no longer be valid and the athlete will need to reauthorize the application.

Examples:

Revoke access for the current athlete

client.revoke

Parameters:

  • options (Hash) (defaults to: {})

    Additional options for the revocation request

Returns:

  • (Authorization)

    Authorization response with revocation confirmation

See Also:



32
33
34
# File 'lib/strava/api/endpoints/oauth.rb', line 32

def revoke(options = {})
  Strava::Models::Authorization.new(post('revoke', { endpoint: Strava::OAuth.config.endpoint }.merge(options)))
end