Skip to content

mgryszko/strava-access-token

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 

Repository files navigation

Strava access token generator

Generate Strava API OAuth2 access token for testing purposes.

Used in pet projects:

  • stra-bash - Strava batch CLI tool written in bash language
  • kstrava - Strava batch CLI tool written in functional Kotlin using Arrow

Installation

Prerequisites

Ruby executable. Tested on macOS with Homebrew Ruby environment managed by rbenv.

Homebrew

brew tap mgryszko/strava
brew install strava-access-token

Usage

strava-access-token <client_id> <client_secret>

If you don't have a client id/secret, register your app following the official Strava documentation.

The script starts a local server (acting as an OAuth2 client) listening on port 8080.

Open your http://localhost:8080/ in your browser and authenticate against Strava. Access token will be displayed in the browser and downloaded to the current working directory as .access-token .

Developer setup

Pre-requisite: install rbenv (Ruby environment), then:

# Replace '<ruby_version>' with latest 2.7 [Ruby release](https://www.ruby-lang.org/en/downloads/).
rbenv install <ruby_version>
rbenv local <ruby_version>

Run

rbenv exec ruby strava-access-token <client_id> <client_secret>

About

Generate Strava API OAuth2 access token for testing

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages