- How do I install the Strava provider for Laravel Socialite?
- Install it with Composer using composer require socialiteproviders/strava. Then register the SocialiteWasCalled event listener for SocialiteProviders\Strava\StravaExtendSocialite in your Laravel app. This package is a subtree split of the SocialiteProviders/Strava provider, so the adapter code lives in the main SocialiteProviders/Providers repository.
- How do I configure Strava OAuth credentials in Laravel?
- Add a strava entry to config/services.php with client_id, client_secret, and redirect values. Keep the values in .env, for example STRAVA_CLIENT_ID, STRAVA_CLIENT_SECRET, and STRAVA_REDIRECT_URI. Add any required Strava scopes to the same driver configuration if your app needs activity data.
- What redirect URL should I use for Strava OAuth in Laravel?
- Use the full callback URL that your Laravel route serves, such as https://your-app.test/auth/strava/callback. Its domain must match the Authorization Callback Domain configured in your Strava API application. If you change the domain or route, update both Laravel and Strava settings.
- How do I log a user in with Strava using Laravel Socialite?
- Redirect the user with Socialite::driver('strava')->redirect() and handle the callback with Socialite::driver('strava')->user(). Socialite validates the OAuth state and exchanges the code for a user and token. Then find or create your local user and log them in with Auth::login().
- Do I need to request Strava scopes to read activities?
- Strava uses OAuth scopes to control access to profile and activity data. Pass the scopes your app needs through the Socialite driver, for example read for basic read access or activity:read_all for all activities. Request only the scopes your app actually uses.
- Can I use this package to connect a Strava account to an existing user?
- Yes. The package handles the Strava OAuth2 handshake, but your app must associate the returned Strava identity and tokens with the logged-in user. Store the Strava user ID and token data in your own table or model. Do not treat the package as a token storage layer.
- Does socialiteproviders/strava handle Strava token refresh?
- The adapter returns the OAuth token data from Socialite, but it does not manage token refresh for your application. Strava access tokens expire and refresh tokens should be stored securely. Implement refresh logic in your app and update the stored token before making Strava API calls.
- Which Laravel versions does socialiteproviders/strava support?
- Support follows the SocialiteProviders core and Laravel Socialite constraints declared in the package composer.json. Check the package releases and composer constraints before upgrading Laravel. In general, use a package version that matches your Laravel and Socialite versions.
- How do I test Strava OAuth in Laravel without hitting Strava?
- Avoid calling the real Strava OAuth flow in automated tests. Mock the Socialite driver or facade so the redirect and user methods return controlled responses. Then assert your callback controller creates or logs in the expected user.
- Is socialiteproviders/strava maintained and where do I report issues?
- This package is a subtree split of the SocialiteProviders/Strava provider, and development happens in the SocialiteProviders/Providers repository. Report issues and send pull requests there rather than to the split repository. Check that repository and Packagist releases for maintenance status.