PHPackages                             rs/socialite-doccheck - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. rs/socialite-doccheck

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

rs/socialite-doccheck
=====================

Laravel Socialite provider for DocCheck SSO (OAuth 2.0).

v2.1.0(1mo ago)12.5kMITPHPPHP ^8.1CI passing

Since May 6Pushed 1mo ago5 watchersCompare

[ Source](https://github.com/RedSnapper/socialite-doccheck)[ Packagist](https://packagist.org/packages/rs/socialite-doccheck)[ Docs](https://github.com/rs/socialite-doccheck)[ RSS](/packages/rs-socialite-doccheck/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (6)Versions (9)Used By (0)

DocCheck Authentication
=======================

[](#doccheck-authentication)

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)

[![Latest Version on Packagist](https://camo.githubusercontent.com/45a99908b4e7e1e64ccca7a44bfdd23b265b59c996472155aa351381a7e18814/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72732f736f6369616c6974652d646f63636865636b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rs/socialite-doccheck)[![GitHub Tests Action Status](https://github.com/redsnapper/socialite-doccheck/workflows/run-tests/badge.svg)](https://github.com/redsnapper/socialite-doccheck/actions)[![Total Downloads](https://camo.githubusercontent.com/fbdb80a47999c5100ab926ab59aa58c6a8e2c82046ff1c47f7184aee8510b9b7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72732f736f6369616c6974652d646f63636865636b2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rs/socialite-doccheck)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require rs/socialite-doccheck
```

Installation &amp; Basic Usage
------------------------------

[](#installation--basic-usage)

Please see the [Base Installation Guide](https://socialiteproviders.com/usage/), then follow the provider specific instructions below.

### Add configuration to `config/services.php`

[](#add-configuration-to-configservicesphp)

```
'doccheck' => [
  'client_id' => env('DOCCHECK_CLIENT_ID'),
  'client_secret' => env('DOCCHECK_CLIENT_SECRET'),
  'redirect' => env('DOCCHECK_REDIRECT_URI')
],
```

### Add provider event listener

[](#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](https://socialiteproviders.com/usage/) for detailed instructions.

```
protected $listen = [
    \SocialiteProviders\Manager\SocialiteWasCalled::class => [
        // ... other providers
        \RedSnapper\SocialiteProviders\DocCheck\DocCheckExtendSocialite::class
    ],
];
```

### Usage

[](#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](https://docs.doccheck.com/login-access/features/personal.html) 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.

### Handling authorization errors

[](#handling-authorization-errors)

DocCheck can redirect back to your callback URL with an OAuth 2.0 error response (`?error=…&error_description=…`) — for example `R0100_PROFESSION_NOT_ALLOWED` when the user's profession isn't on the login-client's whitelist. The package surfaces this as a typed `DocCheckAuthorizationException` from `->user()`:

```
use RedSnapper\SocialiteProviders\DocCheck\DocCheckAuthorizationException;

try {
    $user = Socialite::driver('doccheck')->user();
} catch (DocCheckAuthorizationException $e) {
    // $e->error            e.g. 'R0100_PROFESSION_NOT_ALLOWED' or 'access_denied'
    // $e->errorDescription human-readable text from DocCheck, may be null
    return redirect()->route('login')->withErrors([
        'doccheck' => __('auth.doccheck.not_eligible'),
    ]);
}
```

DocCheck shows its own branded error page before redirecting, so the user already knows roughly what happened — your handler just needs to land them somewhere coherent. The package deliberately does not enumerate DocCheck's error codes; branch on `$e->error` in your application as needed.

### Upgrading from v1

[](#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](CHANGELOG.md).

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Param Dhaliwal](https://github.com/rs)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance89

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~292 days

Recently: every ~184 days

Total

6

Last Release

54d ago

Major Versions

v1.1.2 → v2.0.02026-05-08

PHP version history (2 changes)v1.0.0PHP ^8.0

v2.1.0PHP ^8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6851104?v=4)[rstechnical](/maintainers/rstechnical)[@rstechnical](https://github.com/rstechnical)

---

Top Contributors

[![paramdhal](https://avatars.githubusercontent.com/u/1278858?v=4)](https://github.com/paramdhal "paramdhal (8 commits)")[![cammackmatthew](https://avatars.githubusercontent.com/u/10643740?v=4)](https://github.com/cammackmatthew "cammackmatthew (2 commits)")[![joeuk89](https://avatars.githubusercontent.com/u/6736852?v=4)](https://github.com/joeuk89 "joeuk89 (2 commits)")

---

Tags

doccheckrs

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rs-socialite-doccheck/health.svg)

```
[![Health](https://phpackages.com/badges/rs-socialite-doccheck/health.svg)](https://phpackages.com/packages/rs-socialite-doccheck)
```

###  Alternatives

[socialiteproviders/apple

Apple OAuth2 Provider for Laravel Socialite

629.5M15](/packages/socialiteproviders-apple)[socialiteproviders/microsoft

Microsoft OAuth2 Provider for Laravel Socialite

347.3M25](/packages/socialiteproviders-microsoft)[socialiteproviders/microsoft-azure

Microsoft Azure OAuth2 Provider for Laravel Socialite

597.2M27](/packages/socialiteproviders-microsoft-azure)[socialiteproviders/instagram

Instagram OAuth2 Provider for Laravel Socialite

402.0M5](/packages/socialiteproviders-instagram)[socialiteproviders/saml2

SAML2 Service Provider for Laravel Socialite

172.6M5](/packages/socialiteproviders-saml2)[socialiteproviders/discord

Discord OAuth2 Provider for Laravel Socialite

432.4M22](/packages/socialiteproviders-discord)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
