rs / socialite-doccheck
Laravel Socialite provider for DocCheck SSO (OAuth 2.0).
Requires
- php: ^8.0
- ext-json: *
- socialiteproviders/manager: ~4.0
Requires (Dev)
- orchestra/testbench: ^8.0
- phpunit/phpunit: ^10.0
This package is auto-updated.
Last update: 2026-05-08 11:03:17 UTC
README
With the DocCheck Login you are able to very simply establish a protected area on your site, which is only accessible to (medical) professionals The DocCheck password protection is an identification service for medical sites which is compliant with the German law for pharmaceutical commercial information HWG (Heilmittelwerbegesetz)
Installation
You can install the package via composer:
composer require rs/socialite-doccheck
Installation & Basic Usage
Please see the Base Installation Guide, then follow the provider specific instructions below.
Add configuration to config/services.php
'doccheck' => [ 'client_id' => env('DOCCHECK_CLIENT_ID'), 'client_secret' => env('DOCCHECK_CLIENT_SECRET'), 'redirect' => env('DOCCHECK_REDIRECT_URI') ],
Add provider event listener
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 for detailed instructions.
protected $listen = [ \SocialiteProviders\Manager\SocialiteWasCalled::class => [ // ... other providers \RedSnapper\SocialiteProviders\DocCheck\DocCheckExtendSocialite::class ], ];
Usage
DocCheck's OAuth 2.0 flow requires a language path segment in the authorize URL. Pass it via Socialite's with():
return Socialite::driver('doccheck') ->scopes(['name', 'email', 'occupation_detail']) ->with(['lang' => 'de']) ->redirect();
The package always requests the unique_id scope (DocCheck's mandatory system scope). Add any other scopes your application needs via ->scopes([...]). Available scopes include name, email, profession, occupation_detail, country, language, and address — see DocCheck's scopes documentation for the full list and license requirements. Requested scopes are presented to the user as optional ticks on the consent screen by default; if you need a scope to be required rather than optional, add it to the login-client's "Mandatory Scopes" in DocCheck Access.
After authentication, the user payload uses DocCheck's v2 keys (unique_id, first_name, last_name, email, discipline_id, profession_id). Declined optional scopes are simply omitted from the response — the package's accessors return null cleanly in that case.
Upgrading from v1
v2 is a breaking change. v1 endpoints (login.doccheck.com) are being decommissioned by DocCheck on 2026-06-01. If your application is not yet ready to migrate, lock to ^1.0 — the v1.x tags remain available.
For full breaking-change details, see CHANGELOG.
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.