PHPackages                             halloverden/symfony-oidc-client-bundle - 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. halloverden/symfony-oidc-client-bundle

ActiveSymfony-bundle[Authentication &amp; Authorization](/categories/authentication)

halloverden/symfony-oidc-client-bundle
======================================

OpenID Connect client bundle for symfony

3.10.0(1y ago)13.1k[1 issues](https://github.com/halloverden/symfony-oidc-client-bundle/issues)2MITPHPPHP &gt;=8.2

Since Aug 19Pushed 1y ago2 watchersCompare

[ Source](https://github.com/halloverden/symfony-oidc-client-bundle)[ Packagist](https://packagist.org/packages/halloverden/symfony-oidc-client-bundle)[ RSS](/packages/halloverden-symfony-oidc-client-bundle/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (8)Versions (27)Used By (2)

oidc-client-bundle
==================

[](#oidc-client-bundle)

OpenID Connect client bundle for symfony

Install
=======

[](#install)

1. `composer require halloverden/symfony-oidc-client-bundle`
2. Copy `hallo_verden_oidc_client.yaml` into your project folder and edit it to suit your needs.

### Authenticators

[](#authenticators)

Authenticators can be used to allow authentication with an access token from your OpenID provider.

1. Create class that implements `HalloVerden\Security\Interfaces\OauthUserProviderServiceInterface`
2. Enable authenticators and the class you want to use as services ```
      HalloVerden\Security\Interfaces\OauthUserProviderServiceInterface:
        class: App\Services\OauthUserProviderService # Your class

      HalloVerden\Security\AccessTokenAuthenticator: ~
      HalloVerden\Security\ClientCredentialsAccessTokenAuthenticator: ~
    ```
3. Add authenticators to your security config. ```
      guard:
        authenticators:
          - HalloVerden\Security\AccessTokenAuthenticator
        entry_point: HalloVerden\Security\AccessTokenAuthenticator
    ```

### OauthAuthorizeService

[](#oauthauthorizeservice)

You can use the OauthAuthorizeService to login users from the backend.

1. Enable the service: ```
        HalloVerden\Oidc\ClientBundle\Interfaces\OauthAuthorizeServiceInterface:
            class: HalloVerden\Oidc\ClientBundle\Services\OauthAuthorizeService
            arguments:
                $openIdProviderService: '@hv.oidc.openid_provider.default' # Default refers to the client_configurations key in you config
                $authorizeSuccessUrl: 'http://localhost/success' # Where to redirect the user on success
                $authorizeErrorUrl: 'http://localhost/error' # Where to redirect the user on error
    ```
2. Create two controllers: ```
