# Strava-API API used to communicate with my strava account, will be used as a display project ## WIP and strava oAuth management Right now the oAuth management is a bit manual, I need to get the refresh token manually from strava website, then store it in Infisical vault (or env variable for testing). ### Steps to get refresh token 1. Go to this URL (replace client_id with your strava app client id, redirect_uri with your redirect uri, and scope with the scopes you need): ```https://www.strava.com/oauth/authorize?client_id=181987&response_type=code&redirect_uri=https://louisemard.dev&approval_prompt=force&scope=read,activity:read_all ``` 2. Authorize the application and you will be redirected to the redirect_uri with a code in the URL. 3. Exchange the code for a refresh token by making a POST request to the Strava API: ``` POST https://www.strava.com/oauth/token Content-Type: application/x-www-form-urlencoded client_id=181987 client_secret=YOUR_CLIENT_SECRET code=AUTHORIZATION_CODE grant_type=authorization_code ``` 4. The response will contain the refresh token, which you can then store in your Infisical vault or as an environment variable. The `REFRESH_TOKEN` is then used by the application to get new access tokens when needed. It's linked to your Strava account and allows the application to access your data. ## Infisical setup To use infisical you need to have the following variables in your vault (environment "dev"): - `INFISICAL_CLIENT_SECRET`: your infisical client secret - `INFISICAL_CLIENT_ID`: your infisical client id - `INFISICAL_URL`: Infisical url, mine is `https://vault.louisemard.dev` - `INFISICAL_PROJECT_ID`: Project where the secrets are stored, right now only one project is supported