-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stravalib Authorization Error #111
Comments
I have an export file from Strava, too, but https://github.com/flopp/StravaExportToGPX fails to convert those into GPXs... |
I had the same issue. Here is how I modified client = Client()
#### line 137
scope = ['read', 'profile:read_all', 'activity:read']
url = client.authorization_url(client_id=strava_data["client_id"], redirect_uri='http://127.0.0.1:5000/authorization', scope=scope)
print("Open the following URL, give authorisation and wait to be redirected")
print(url)
print("Copy/paste the value of code from the url of the page you were redirected to...")
code = str(input())
client = Client()
token_response = client.exchange_code_for_token(client_id=strava_data["client_id"],
client_secret=strava_data["client_secret"],
code=code)
ACCESS_TOKEN = token_response['access_token']
REFRESH_TOKEN = token_response['refresh_token'] # You'll need this in 6 hours
# REFRESH
# token_response = client.refresh_access_token(client_id=MY_STRAVA_CLIENT_ID,
# client_secret=MY_STRAVA_CLIENT_SECRET,
# refresh_token=REFRESH_TOKEN)
# ACCESS_TOKEN = token_response['access_token']
# REFRESH_TOKEN = token_response['refresh_token'] # You'll need this in 6 hours
client = Client(access_token=ACCESS_TOKEN)
####
# response = client.refresh_access_token(**strava_data)
# client.access_token = response["access_token"]
filter_dict = {"before": datetime.datetime.utcnow()} |
Work like a charm! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've updated the stock
strava.json
with my info from https://www.strava.com/settings/api, akin toThen I run
create_poster --from-strava strava.json --year 2023
, but the process fails with an error in stravalib.The error is
stravalib.exc.AccessUnauthorized: Unauthorized: Authorization Error: [{'resource': 'AccessToken', 'field': 'activity:read_permission', 'code': 'missing'}]
.On the Strava API page I also see an 'Access Token' for my account, do I have to enter that somewhere, too?
The text was updated successfully, but these errors were encountered: