Download the PHP package socialiteproviders/cognito without Composer
On this page you can find all versions of the php package socialiteproviders/cognito. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package cognito
Cognito
Installation & Basic Usage
Please see the Base Installation Guide, then follow the provider specific instructions below.
Add configuration to config/services.php
Add provider event listener
Laravel 11+
In Laravel 11, the default EventServiceProvider
provider was removed. Instead, add the listener using the listen
method on the Event
facade, in your AppServiceProvider
boot
method.
- Note: You do not need to add anything for the built-in socialite providers unless you override them with your own providers.
Laravel 10 or below
Configure the package's listener to listen for `SocialiteWasCalled` events. Add the event to your `listen[]` array in `app/Providers/EventServiceProvider`. See the [Base Installation Guide](https://socialiteproviders.com/usage/) for detailed instructions.Usage
You should now be able to use the provider like you would regularly use Socialite (assuming you have the facade installed):
Logout of app and cognito then redirect to url
Logout of app and cognito then redirect back to login UI.
Example env
Helpful tips
- Cognito requires SSL, try ngrok for local testing (works for everything except logout url).
- Returned user array contains all available attributes (set these in your cognito client app).
- If receiving state errors try this
$user = Socialite::driver('cognito')->stateless()->user();
- "sub" is Cognito UUID, more info on attributes
- .env COGNITO_CALLBACK_URL must in your Cognito client app Callback URL(s)
- .env COGNITO_SIGN_OUT_URL must in your Cognito client app Sign out URL(s)
Returned User fields
id
nickname
name
email
avatar
user[]
Available Cognito Attributes