PHPackages                             oleksandr-yushchenko/oauth2-vipps - 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. oleksandr-yushchenko/oauth2-vipps

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

oleksandr-yushchenko/oauth2-vipps
=================================

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

1.0.1(11mo ago)0113MITPHPCI passing

Since Jul 29Pushed 11mo agoCompare

[ Source](https://github.com/oleksandr-yushchenko/oauth2-vipps)[ Packagist](https://packagist.org/packages/oleksandr-yushchenko/oauth2-vipps)[ RSS](/packages/oleksandr-yushchenko-oauth2-vipps/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

Vipps Provider for OAuth 2.0 Client
===================================

[](#vipps-provider-for-oauth-20-client)

This package provides Vipps 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 oleksandr-yushchenko/oauth2-vipps

```

Usage
-----

[](#usage)

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

### Authorization Code Flow

[](#authorization-code-flow)

```
$provider = new League\OAuth2\Client\Provider\Vipps([
    // Required
    'clientId'                  => '{vipps-client-id}',
    'clientSecret'              => '{vipps-client-secret}',
    'redirectUri'               => 'https://example.com/callback-url',
    // Optional
    'subscriptionKey'           => '{vipps-subscription-key}',
    'merchantSerialNumber'      => '{vipps-merchant-serial-number}',
    'partnerMode'               => TRUE,
    'testMode'                  => TRUE,
]);

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

    // If we don't have an authorization code then get one
    $authUrl = $provider->getAuthorizationUrl();
    $_SESSION['oauth2state'] = $provider->getState();
    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
        $user = $provider->getResourceOwner($token);

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

    } catch (Exception $e) {

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

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

Credits
-------

[](#credits)

- [Oleksandr Yushchenko](https://github.com/oleksandr-yushchenko)
- [All Contributors](https://github.com/Oleksandr-Yushchenko/oauth2-vipps/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/oleksandr-yushchenko/oauth2-vipps/blob/master/LICENSE) for more information.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance51

Moderate activity, may be stable

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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

Every ~0 days

Total

2

Last Release

340d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2a5bf875faffb098207e56896040e83821db49ad20aa2759e0697de354ad8291?d=identicon)[oleksandr-yushchenko](/maintainers/oleksandr-yushchenko)

---

Top Contributors

[![oleksandr-yushchenko](https://avatars.githubusercontent.com/u/55089064?v=4)](https://github.com/oleksandr-yushchenko "oleksandr-yushchenko (14 commits)")

---

Tags

clientoauthoauth2authorizationauthorisationvippssign-in-with-vipps

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/oleksandr-yushchenko-oauth2-vipps/health.svg)

```
[![Health](https://phpackages.com/badges/oleksandr-yushchenko-oauth2-vipps/health.svg)](https://phpackages.com/packages/oleksandr-yushchenko-oauth2-vipps)
```

###  Alternatives

[stevenmaguire/oauth2-keycloak

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

2306.4M45](/packages/stevenmaguire-oauth2-keycloak)[thenetworg/oauth2-azure

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

25310.7M83](/packages/thenetworg-oauth2-azure)[patrickbussmann/oauth2-apple

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

1152.8M12](/packages/patrickbussmann-oauth2-apple)[omines/oauth2-gitlab

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

36779.2k16](/packages/omines-oauth2-gitlab)[league/oauth2-instagram

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

661.1M48](/packages/league-oauth2-instagram)[mollie/oauth2-mollie-php

Mollie Provider for OAuth 2.0 Client

261.8M1](/packages/mollie-oauth2-mollie-php)

PHPackages © 2026

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