uptime-development/laravel-socialite-criipto

A custom Criipto driver for Laravel Socialite

v1.0.3 2023-02-24 06:43 UTC

This package is auto-updated.

Last update: 2024-04-24 09:22:41 UTC


README

This package is a custom Criipto driver for Laravel Socialite. This packages may be used for authenticating users with MitID

Installation

You can install the package via composer:

composer require uptime-development/laravel-socialite-criipto

Usage

Once you install the package, you will ned to create a account on https://criipto.id

Add the config values in you config/services.php configuration file from the newly created account:

'criipto' => [
    'base_uri' => env('CRIIPTO_URI'),
    'client_id' => env('CRIIPTO_CLIENT_ID'),
    'client_secret' => env('CRIIPTO_CLIENT_SECRET'),
    'redirect' => env('CRIIPTO_REDIRECT_URI'),
],

You can nowuse the driver as you would use it in the Laravel Socialite's official documentation. Use criipto keyword when you want to use the driver followed with the extra parameter to define the acr_values

Route::get('/auth/redirect', function () {
    return Socialite::driver('criipto')
            ->with(['acr_values' => 'urn:grn:authn:dk:mitid:low'])
            ->redirect();
});
Route::get('/auth/callback', function () {
    $user = Socialite::driver('criipto')->user();
    dd($user);
});

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

If you discover any security related issues, please email anders.andersen@uptimedevelopment.dk

License

The MIT License (MIT). Please see License File for more information.

Todo

[ ] Github Action - Should run tests and php-cs-fixer