PHPackages                             learningpool/oauth2-signonotron - 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. learningpool/oauth2-signonotron

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

learningpool/oauth2-signonotron
===============================

Sign-On-O-Tron OAuth 2.0 Client Provider for The PHP League OAuth2-Client

010PHP

Since Sep 7Pushed 9y ago4 watchersCompare

[ Source](https://github.com/LearningPool/oauth2-signonotron)[ Packagist](https://packagist.org/packages/learningpool/oauth2-signonotron)[ RSS](/packages/learningpool-oauth2-signonotron/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (4)Used By (0)

Sign-On-O-Tron Provider for OAuth 2.0 Client
============================================

[](#sign-on-o-tron-provider-for-oauth-20-client)

[![Build Status](https://camo.githubusercontent.com/a3c26f272fae1bf3f388e6396762bf4347bd0bc4cd794a4d5354ae5d5cc5442e/68747470733a2f2f7472617669732d63692e6f72672f726c6166666572747930352f6f61757468322d7369676e6f6e6f74726f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/rlafferty05/oauth2-signonotron)[![Latest Stable Version](https://camo.githubusercontent.com/3237b19d531b581b659885200d20d4eb68846096263189a7eba208cf946607f8/68747470733a2f2f706f7365722e707567782e6f72672f726c6166666572747930352f6f61757468322d7369676e6f6e6f74726f6e2f762f737461626c652e737667)](https://packagist.org/packages/rlafferty05/oauth2-signonotron)

This package provides Sign-On-O-Tron OAuth 2.0 support for the PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).

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

[](#installation)

To install, use composer:

```
composer require rlafferty05/oauth2-signonotron

```

Usage
-----

[](#usage)

Usage is the same as The League's OAuth client, using `\Learningpool\OAuth2\Client\Provider\Signonotron` as the provider.

### Sign-On-O-Tron URL

[](#sign-on-o-tron-url)

Unlike many other SSO providers, Sign-On-O-Tron doesn't have one central location. Different organisations can set up their own Sign-On-O-Tron connection with different URLs, so we need to include the correct URL. This can be done by renaming signonotron.ini.dist to signonotron.ini in the src/Provider folder and changing the site\_url variable in the ini file to point to the correct location.

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new Learningpool\OAuth2\Client\Provider\Signonotron([
    'clientId'          => '{signonotron-client-id}',
    'clientSecret'      => '{signonotron-client-secret}',
    'redirectUri'       => 'https://example.com/callback-url'
]);

if (!isset($_GET['code'])) {

    // If we don't have an authorization code then get one
    $authUrl = $provider->getAuthorizationUrl();
    $_SESSION['oauth2state'] = $provider->state;
    header('Location: '.$authUrl);
    exit;

// Check given state against previously stored one to mitigate CSRF attack
} elseif (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {

    unset($_SESSION['oauth2state']);
    exit('Invalid state');

} else {

    // Try to get an access token (using the authorization code grant)
    $token = $provider->getAccessToken('authorization_code', [
        'code' => $_GET['code']
    ]);

    // Optional: Now you have a token you can look up a users profile data
    try {

        // We got an access token, let's now get the user's details
        $userDetails = $provider->getUserDetails($token);

        // Use these details to create a new profile
        printf('Hello %s!', $userDetails->name);

    } catch (Exception $e) {

        // Failed to get user details
        exit('Oh dear...');
    }

    // Use this to interact with an API on the users behalf
    echo $token->accessToken;
}
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/rlafferty05/oauth2-signonotron/LICENSE) for more information.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/560955?v=4)[Ryan Lothian](/maintainers/ryanl)[@ryanl](https://github.com/ryanl)

---

Top Contributors

[![rlafferty05](https://avatars.githubusercontent.com/u/7962630?v=4)](https://github.com/rlafferty05 "rlafferty05 (6 commits)")

### Embed Badge

![Health badge](/badges/learningpool-oauth2-signonotron/health.svg)

```
[![Health](https://phpackages.com/badges/learningpool-oauth2-signonotron/health.svg)](https://phpackages.com/packages/learningpool-oauth2-signonotron)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.2M17](/packages/kartik-v-yii2-password)

PHPackages © 2026

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