- How do I install the eduID Socialite provider in Laravel?
- Require the package with Composer using composer require socialiteproviders/eduid. It is part of the Socialite Providers community collection, so it plugs into Laravel Socialite rather than replacing it. Make sure laravel/socialite is installed in your application before wiring up the driver.
- How do I configure eduID client credentials in Laravel?
- Add an eduid entry to config/services.php containing your client_id, client_secret, and redirect URI, and keep the actual values in your .env file. The driver reads these standard Socialite credential keys, so no custom configuration class is needed. The redirect URI must exactly match the callback URL registered with eduID.
- How do I redirect users to eduID and handle the callback with Socialite?
- Create a controller with two actions: one that returns Socialite::driver('eduid')->redirect() and one that handles the callback with Socialite::driver('eduid')->user(). Register both routes in your Laravel routes file, pointing the callback at the same URI you configured in services.php and with eduID. Because the package is a Socialite driver, the flow is identical to GitHub, Google, or any other provider.
- Which Laravel and Socialite versions does socialiteproviders/eduid support?
- The package follows the Socialite Providers release line, so it targets the Laravel and Socialite versions supported by that collection. Check the package requirements on Packagist or in its composer.json before upgrading Laravel, since major Socialite releases occasionally change driver contracts. Pinning a compatible version in composer.json avoids surprises during framework upgrades.
- What user data does Socialite::driver('eduid')->user() return?
- The driver returns a standard Socialite user object populated with the eduID profile data available from the provider. You can call the usual methods such as getId(), getName(), getEmail(), and getAvatar(), plus getRaw() for the full payload. Persist the returned eduID identifier alongside your local user record so repeat logins map to the same account.
- Do I need to register the provider with the Socialite Providers listener?
- Yes. Socialite Providers packages are registered through the SocialiteProviders\SocialiteWasCalled event listener, typically added to your EventServiceProvider. Without that registration, Laravel Socialite will not know how to resolve the eduid driver and will throw an error about an unsupported driver. The Socialite Providers documentation shows the exact listener entry to add.
- Can I use the eduID Socialite provider in a stateless API-only Laravel app?
- Socialite's redirect and callback flow relies on sessions to store the OAuth state, so a stateless API needs session support on those two routes or a separate web guard. Once the callback completes you can issue your own API token, such as a Sanctum token, for subsequent requests. The provider itself only handles the OAuth exchange and does not manage token issuance for your app.
- How do I test eduID login in Laravel without hitting the real eduID server?
- Mock the Socialite driver in your feature tests using Socialite::shouldReceive('driver') and return a fake user object, which keeps tests fast and offline. Alternatively, use Laravel's HTTP client fakes to stub the token and userinfo endpoints the driver calls. Either approach lets you assert that your callback controller creates or logs in the correct local user.
- Is socialiteproviders/eduid suitable for production use?
- It is a thin driver on top of Laravel Socialite, so production readiness depends mostly on your own credential handling and session security. Store the client secret in environment variables, enforce HTTPS on the callback route, and validate state via Socialite's built-in handling. Because the driver is community-maintained, review recent releases and issue activity before committing to it.
- What are the alternatives to this package for eduID login in Laravel?
- You can implement the OAuth 2.0 authorization-code flow yourself with Laravel's HTTP client if you need full control over scopes or claims. Other options include generic OIDC or SAML packages, which may fit better if your institution's identity federation requires those protocols. This package is the simplest choice when you specifically want eduID through the familiar Socialite API.