#!/usr/bin/perl use strict; use warnings; use LWP::Authen::OAuth2; use JSON; # The client id and secret from the client_secret.json file my $client_id = "081533311"; my $client_secret = "unknown"; # construct the OAuth2 object my $oauth2 = LWP::Authen::OAuth2->new( authorization_endpoint => 'https://www.strava.com/oauth/authorize', client_id => $client_id, # your application’s ID, obtained during registration client_secret => $client_secret, # APP-TOKEN redirect_uri => "http://localhost/exchange_token", # from client_secret.json approval_prompt => "force", scope => "read", ); # get the authentication url, give the user an opportunity to navigate to the # url, copy the auth code, and paste it my $url = $oauth2->authorization_url(); print "Authorization URL: $url\n";