PHPackages                             rs/auth-onekey - 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/auth-onekey

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

rs/auth-onekey
==============

A phpCAS Laravel wrapper for OneKey, an authentication system for healthcare professionals from IQVIA.

v1.2.1(1y ago)02.6kMITPHPPHP ^8.0

Since Oct 14Pushed 1y ago4 watchersCompare

[ Source](https://github.com/RedSnapper/auth-onekey)[ Packagist](https://packagist.org/packages/rs/auth-onekey)[ RSS](/packages/rs-auth-onekey/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (11)Used By (0)

\#Auth/OneKey

### A phpCAS Laravel wrapper for OneKey, an authentication system for healthcare professionals from IQVIA

[](#a-phpcas-laravel-wrapper-for-onekey-an-authentication-system-for-healthcare-professionals-from-iqvia)

[![Latest Version on Packagist](https://camo.githubusercontent.com/fab1823996a2233b7f5fc6cf4eaf0723a92f06d477fa2de6dca91ed0f0ddf701/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f72732f617574682d6f6e656b65792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rs/auth-onekey)[![GitHub Tests Action Status](https://github.com/redsnapper/auth-onekey/workflows/run-tests/badge.svg)](https://github.com/redsnapper/auth-onekey/actions)[![Total Downloads](https://camo.githubusercontent.com/7fcb3ec9deb3c99f198d69d4db0d379d9bc385795eb41ab22bf20cbe249c8fde/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f72732f617574682d6f6e656b65792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/rs/auth-onekey)

---

This repo can be used to provide SSO authentication with \[OneKey\] ().

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

[](#installation)

You can install the package via composer:

```
composer require rs/auth-onekey
```

But default, the package is set to the `debug = false` and `live = true` mode. The latter determines the provider url that the client is redirected to (`live = true` - '[www.owa-secure.com](http://www.owa-secure.com)', `live = false` - '[www.rowa-secure.com](http://www.rowa-secure.com)') If you would like to override it, publish the config file:

```
php artisan vendor:publish --tag=onekey-config
```

Once the `onekey.php` config file has been published, update your `.env` file:

```
//.env

ONE_KEY_DEBUG=
ONE_KEY_LIVE=
```

Usage
-----

[](#usage)

Register your route

```
//web.php

Route::get('onekey/callback', [OneKeyLoginController::class, 'handleProviderCallback']);
```

Then, implement the `handleProviderCallback()` method in your controller. For example:

```
//Http\Controllers\OneKeyLoginController.php

use RedSnapper\OneKey\OneKeyProvider;

//..//

public function handleProviderCallback(OneKeyProvider $provider)
{   // Get OneKey user from the provider
    $providerUser = $provider->user();

    //Map the one-key user with your User model, save in DB
    // or perform any other action
    $user = new User([
        'id' => $providerUser->getId(),
        'name' => $providerUser->getFullName(),
        'email' => $providerUser->getEmail(),
        'guard' => 'web'
    ]);

    session()->put($user->guard, $user->toArray());
    auth($user->guard)->login($user);

    return redirect()->intended();
}
```

\###All available methods for getting user data:

```
$user = $provider->user();

$user->getId(); //?string
$user->getEmail(); //?string
$user->getFirstName(); //?string
$user->getLastName(); //?string
$user->getFullName(); //?string
$user->getCity(); //?string
$user->getProfession(); //?string
$user->getPhone(); //?string
$user->isHCP(); //bool
$user->trustLevel(); //int

$user->getRaw(); //array
```

Testing
-------

[](#testing)

```
vendor/bin/phpunit
```

or

```
composer test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](.github/CONTRIBUTING.MD) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [Licence File](LICENCE.MD) for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~122 days

Recently: every ~267 days

Total

10

Last Release

570d ago

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

v1.2.0PHP ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1785064?v=4)[Mr Ben Griffin](/maintainers/MrBenGriffin)[@MrBenGriffin](https://github.com/MrBenGriffin)

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rs-auth-onekey/health.svg)

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

###  Alternatives

[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)[visanduma/nova-two-factor

Nova Two Factor Authentication

56621.3k](/packages/visanduma-nova-two-factor)[l3/cas-bundle

PHPCas wrapper for Symfony2, Symfony3, Symfony4, Symfony5

3441.1k](/packages/l3-cas-bundle)

PHPackages © 2026

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