rs / auth-medikey
Authentication for medikey service
Installs: 1 677
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 4
Forks: 0
Open Issues: 0
Requires
- php: ^8.0
- ext-json: *
- ext-libxml: *
- ext-simplexml: *
- illuminate/http: ^10.0|^11.0
- illuminate/support: ^10.0|^11.0
Requires (Dev)
- guzzlehttp/guzzle: ^7.3
- orchestra/testbench: ^8.0
- phpunit/phpunit: ^10.0
- spatie/array-to-xml: ^2.0
README
Medikey is the innovative service that allows the certification and the recognition of the Italian physicians: a single initial process of registration allows the physician to obtain two univocal access keys (username and password) through which one can automatically access all the reserved websites that have adhered to Medikey, avoiding new, long and repetitive registrations for each website.
Installation
You can install the package via composer:
composer require rs/auth-medikey
Usage
Before using auth-medikey, you will need to add the site id for your implementation of Medikey. These credentials should be placed in your application's config/services.php configuration file, and should use the key medikey.
'medikey' => [ 'site_id' => env('MEDIKEY_SITE_ID','5') ]
Authentication
To authenticate users using the Medikey provider, you will need two routes: one for redirecting the user to the provider, and another for receiving the callback from the provider after authentication. The example controller below demonstrates the implementation of both routes:
use RedSnapper\Medikey\MedikeyProvider; Route::get('/auth/redirect', function (MedikeyProvider $provider) { return $provider->redirect(); }); Route::get('/auth/callback', function (MedikeyProvider $provider) { $user = $provider->user(); });
The redirect method provided takes care of redirecting the user to the provider, while the user method will read the incoming request and retrieve the user's information from the provider after they are authenticated.
Testing
composer test
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email param@redsnapper.net instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.