PHPackages                             comman-group/comman\_id\_oauth2 - 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. comman-group/comman\_id\_oauth2

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

comman-group/comman\_id\_oauth2
===============================

COMMAN ID OAuth 2.0 Client Provider for The PHP League OAuth2-Client

v0.9.6(4y ago)05MITPHPPHP ^7.3 || ^8

Since Feb 15Pushed 4y agoCompare

[ Source](https://github.com/comman-group/comman_id_oauth2)[ Packagist](https://packagist.org/packages/comman-group/comman_id_oauth2)[ RSS](/packages/comman-group-comman-id-oauth2/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (10)Dependencies (2)Versions (16)Used By (0)

COMMAN ID oauth2 client
=======================

[](#comman-id-oauth2-client)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

This package provides [COMMAN](https://id.comman.com) integration for [OAuth2 Client](https://github.com/thephpleague/oauth2-client) by the League.

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

[](#installation)

Configure repository in composer.json
-------------------------------------

[](#configure-repository-in-composerjson)

```
"repositories": [{
    "type": "git",
    "url": "https://github.com/comman-group/comman_id_oauth2"
    }
]
```

Just execute:
-------------

[](#just-execute)

```
composer require knpuniversity/oauth2-client-bundle
composer require comman-group/comman_id_oauth2
```

Usage
-----

[](#usage)

```
$provider = new \Comman\OAuth2\Client\Provider\CommanProvider([
    'clientId' => 'client_id',
    'clientSecret' => 'secret',
    'redirectUri' => 'https://example.org/oauth/endpoint',
]);
```

Example of knpu\_oauth2\_client.yaml
------------------------------------

[](#example-of-knpu_oauth2_clientyaml)

```
knpu_oauth2_client:
    clients:
        comman_oauth_client:
            type: generic
            provider_class: Comman\OAuth2\Client\Provider\CommanProvider
            client_id: '%env(OAUTH_COMMAN_ID)%'
            client_secret: '%env(OAUTH_COMMAN_SECRET)%'
            redirect_route: auth_comman_endpoint
            redirect_params: {}
```

Example of symfony controller
-----------------------------

[](#example-of-symfony-controller)

```
