PHPackages                             gorontalokota/sso-client - 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. gorontalokota/sso-client

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

gorontalokota/sso-client
========================

SSO Integration for PHP

v1.0.0(3y ago)111MITPHP

Since Aug 27Pushed 3y ago1 watchersCompare

[ Source](https://github.com/rivaisali/SSO-Kota-Gorontalo)[ Packagist](https://packagist.org/packages/gorontalokota/sso-client)[ RSS](/packages/gorontalokota-sso-client/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

Integrasi SSO-Kota Gorontalo menggunakan PHP
============================================

[](#integrasi-sso-kota-gorontalo-menggunakan-php)

Library ini menggunakan dan support PHP League's [OAuth 2.0 Client](https://github.com/thephpleague/oauth2-client).

Instalasi
---------

[](#instalasi)

Instalasi menggunakan composer :

```
composer require gorontalokota/sso-client

```

Cara Menggunakan
----------------

[](#cara-menggunakan)

### Menggunakan Authorization Code

[](#menggunakan-authorization-code)

#### Untuk Login

[](#untuk-login)

```
require(__DIR__ . "/vendor/autoload.php");

use Gorontalokota\SSO\Client\Provider\Broker;

$provider = new Broker([
    'realm'                     => '{Realms}',
    'clientId'                  => '{clientID}',
    'clientSecret'              => '{clientSecret}',
    'redirectUri'               => '{http://example/oauth/authorized}',
]);

$authUrl = $provider->getAuthorizationUrl();
//Simpan status Auth ke Session untuk mencegah csrf
$_SESSION['oauth2state'] = $provider->getState();
//Redirect Url Auth
header('Location: '.$authUrl);
```

#### Untuk Get User Information

[](#untuk-get-user-information)

```
require(__DIR__ . "/vendor/autoload.php");

use Gorontalokota\SSO\Client\Provider\Broker;

$provider = new Broker([
    'realm'                     => '{Realms}',
    'clientId'                  => '{clientID}',
    'clientSecret'              => '{clientSecret}',
    'redirectUri'               => '{http://example/oauth/authorized}',
]);

 //Periksa status yang diberikan terhadap status yang disimpan sebelumnya untuk mengurangi serangan CSRF
 if (empty($_GET['state']) || ($_GET['state'] !== $_SESSION['oauth2state'])) {
    unset($_SESSION['oauth2state']);
    exit('Invalid state, make sure HTTP sessions are enabled.');

} else {
try {
        $token = $provider->getAccessToken('authorization_code', [
            'code' => $_GET['code']
        ]);

         $user = $provider->getResourceOwner($token);
         $user->getUsername();
         $user->getEmail();
         $user->getName();

    } catch (Exception $e) {
        exit('Failed to get access token: '.$e->getMessage());
    }
}
```

#### Refresh Token

[](#refresh-token)

```
require(__DIR__ . "/vendor/autoload.php");

use Gorontalokota\SSO\Client\Provider\Broker;

$provider = new Broker([
    'realm'                     => '{Realms}',
    'clientId'                  => '{clientID}',
    'clientSecret'              => '{clientSecret}',
    'redirectUri'               => '{http://example/oauth/authorized}',
]);

$token = $provider->getAccessToken('refresh_token',
            ['refresh_token' => $token->getRefreshToken()]);
```

#### Untuk Logout

[](#untuk-logout)

```
require(__DIR__ . "/vendor/autoload.php");

use Gorontalokota\SSO\Client\Provider\Broker;

$provider = new Broker([
    'realm'                     => '{Realms}',
    'clientId'                  => '{clientID}',
    'clientSecret'              => '{clientSecret}',
    'redirectUri'               => '{http://example/oauth/authorized}',
]);

$authUrl = $provider->getLogoutUrl();
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1352d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fd5c4378b6212bf24f60d49fe57752ede7734d3203bf287302879917a32b6c83?d=identicon)[rivaisali](/maintainers/rivaisali)

---

Top Contributors

[![rivaisali](https://avatars.githubusercontent.com/u/10910732?v=4)](https://github.com/rivaisali "rivaisali (14 commits)")

---

Tags

sso-client

### Embed Badge

![Health badge](/badges/gorontalokota-sso-client/health.svg)

```
[![Health](https://phpackages.com/badges/gorontalokota-sso-client/health.svg)](https://phpackages.com/packages/gorontalokota-sso-client)
```

###  Alternatives

[google/auth

Google Auth Library for PHP

1.4k272.7M161](/packages/google-auth)[thenetworg/oauth2-azure

Azure Active Directory OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2509.6M48](/packages/thenetworg-oauth2-azure)[stevenmaguire/oauth2-keycloak

Keycloak OAuth 2.0 Client Provider for The PHP League OAuth2-Client

2275.9M27](/packages/stevenmaguire-oauth2-keycloak)[league/oauth2-google

Google OAuth 2.0 Client Provider for The PHP League OAuth2-Client

41721.2M118](/packages/league-oauth2-google)[patrickbussmann/oauth2-apple

Sign in with Apple OAuth 2.0 Client Provider for The PHP League OAuth2-Client

1132.5M6](/packages/patrickbussmann-oauth2-apple)[robsontenorio/laravel-keycloak-guard

🔑 Simple Keycloak Guard for Laravel

5161.1M3](/packages/robsontenorio-laravel-keycloak-guard)

PHPackages © 2026

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