PHPackages                             kdefives/oauth2-riot - 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. kdefives/oauth2-riot

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

kdefives/oauth2-riot
====================

Riot (RSO) OAuth 2.0 support for the PHP League's OAuth 2.0 Client

v1.0.0(5y ago)91.4kMITPHPCI failing

Since Feb 5Pushed 5y ago2 watchersCompare

[ Source](https://github.com/kdefives/oauth2-riot)[ Packagist](https://packagist.org/packages/kdefives/oauth2-riot)[ RSS](/packages/kdefives-oauth2-riot/feed)WikiDiscussions main Synced 1w ago

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

oauth2-riot
===========

[](#oauth2-riot)

Riot (RSO) OAuth 2.0 support for the PHP League's OAuth 2.0 Client

[![version](https://camo.githubusercontent.com/4f7e0d0b2eb3de8c977c19f21c7250bee9dcbaef07d742736035565ed3a1f2e6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c7565)](https://camo.githubusercontent.com/4f7e0d0b2eb3de8c977c19f21c7250bee9dcbaef07d742736035565ed3a1f2e6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d626c7565) [![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

Riot Provider for OAuth 2.0 Client
==================================

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

*Thanks to this [(Google Provider)](https://github.com/thephpleague/oauth2-google) used as example to build this provider.*

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

This package has been tested with this bundle: .
Please find below a usage example using this bundle.

The following versions of PHP are supported.

- PHP 7.3
- PHP 7.4

Package to authenticate users with Riot ID accounts using RSO (Riot Sign On).

**Note:**To implement Riot RSO, it will be necessary to have an RSO account client ID and client secret. These are referred in the RSO documentation :

Requirements
------------

[](#requirements)

Declare parameters below in your knpu\_oauth2\_client.yaml:

- url\_authorization (eg.: )
- url\_token (eg.: )
- url\_user\_info (eg.: )

Example for knpu\_oauth2\_client declaration using :

```
# file : app\config\packages\knpu_oauth2_client.yaml

knpu_oauth2_client:
    clients:
        # configure your clients as described here: https://github.com/knpuniversity/oauth2-client-bundle#configuration
        # will create service: "knpu.oauth2.client.foo_bar_oauth"
        # an instance of: KnpU\OAuth2ClientBundle\Client\OAuth2Client
        riot_oauth:
            type: generic
            provider_class: League\OAuth2\Client\Provider\Riot

            # optional: a class that extends OAuth2Client
            # client_class: Some\Custom\Client

            # optional: if your provider has custom constructor options
            provider_options:
                url_authorization: '%env(URL_AUTHORIZATION)%'
                url_token: '%env(URL_TOKEN)%'
                url_user_info: '%env(URL_USERINFO)%'

            # now, all the normal options!
            client_id: '%env(riot_client_id)%'
            client_secret: '%env(riot_client_secret)%'
            redirect_route: connect_riot_check
            redirect_params: {}
```

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

[](#installation)

To install, use composer:

```
composer require kdefives/oauth2-riot
```

Usage
-----

[](#usage)

Please find a usage example below. Read the README documentation of knpuniversity/oauth2-client-bundle to know how to integrate a provider :

### Authorization Code Flow example using Symfony 5.2.2 (tested with PHP-7.4)

[](#authorization-code-flow-example-using-symfony-522-tested-with-php-74)

#### Authenticator declaration

[](#authenticator-declaration)

```
