PHPackages                             autisid/laravel-oidc-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. autisid/laravel-oidc-client

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

autisid/laravel-oidc-client
===========================

Laravel OpenID Connect client

1.0.0(3y ago)2123[1 issues](https://github.com/autisid/laravel-oidc-client/issues)MITPHPPHP &gt;=8.0

Since Feb 3Pushed 3y ago1 watchersCompare

[ Source](https://github.com/autisid/laravel-oidc-client)[ Packagist](https://packagist.org/packages/autisid/laravel-oidc-client)[ RSS](/packages/autisid-laravel-oidc-client/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)DependenciesVersions (2)Used By (0)

OIDC Client
===========

[](#oidc-client)

A Laravel package for delegating authentication to an OpenID Provider.

> This package is an heavenly modified fork of [cabinetoffice / oidc-client — Bitbucket](https://bitbucket.org/cabinetoffice/oidc-client)

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

[](#requirements)

- PHP 8.0+
- Laravel 8+
- Composer 2

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

[](#installation)

Begin by adding this package to your depedencies with the command:

```
composer require autisid/laravel-oidc-client
```

If you have opted out from auto discovery, you'll need to add the following line to the list of registered service providers in `config/app.php`:

```
Autisid\OIDCClient\OIDCServiceProvider::class
```

Edit your `config/auth.php` file to use OpenID as the authentication method for your users:

```
'guards' => [
    'web' => [
        'driver' => 'oidc',
        ...
    ],
    ...
],
```

Configuration
-------------

[](#configuration)

You can set the following environment variables to adjust the package settings:

- `OIDC_CLIENT_ID`: Client ID of your app. This is commonly provided by your OIDC provider.
- `OIDC_CLIENT_SECRET`: Client secret of your app. This is commonly provided by your OIDC provider.
- `OIDC_PROVIDER_URL`: URL of your OIDC provider. This is used if your provider supports OIDC Auto Discovery.
- `OIDC_PROVIDER_NAME`: This is a short name for your OpenID provider, which will only appears in your OpenID routes. Do not use spaces. Defaults to `oidc`
- `OIDC_CALLBACK_ROUTE_PATH`: A path (with or without leading slash) to append to the provider name, to make the callback route path. Defaults to `callback`Example with the default values: `oidc/callback` (`OIDC_PROVIDER_NAME` + `/` + `OIDC_CALLBACK_ROUTE_PATH`)
- `OIDC_VERIFY`: Verify SSL when sending requests to the server. Defaults to `true`. (Optional: You can set `OIDC_CERT_PATH` to an SSL certificate path if you set this option to `false`)
- `OIDC_HTTP_PROXY`: If you have a proxy, set it here.
- `OIDC_SCOPES`: A list of scopes, separated by a comma (`,`). Defaults to `['openid']`. Example of valid value: `openid,email`
- `OIDC_AUTHORIZATION_ENDPOINT_QUERY_PARAMS`: A list of query parameters to add to the authorization endpoint encoded as a JSON object. Example of valid value: `{"response_type":"code"}`
- `OIDC_DISABLE_STATE_MIDDLEWARE_FOR_POST_CALLBACK`: A boolean to disable the registration of the `OIDCStateMiddleware` middleware.
    This middleware rebuilds the session token held in the `state` parameter of a `POST` request to the `callback` route.
- `OIDC_SUB_COLUMN`: A column name to store uuid from openid to your user table.

You can find other options to set and their env variables in `config/oidc.php`. Note that some options are not required (like endpoints) if you use OIDC auto discovery!

You can also publish the config file (`config/oidc.php`) if you want:

```
php artisan vendor:publish --provider="Autisid\OIDCClient\OIDCServiceProvider"
```

How to use
----------

[](#how-to-use)

Once everything is set up, you can replace your login system with a call to the route `route('oidc.login')`. For logouts, use the route `route('oidc.logout')`.

You can set the following environment variables to specify the routes/URLs you want your users to be redirected to upon successful authentication/logout: `OIDC_REDIRECT_PATH_AFTER_LOGIN` and `OIDC_REDIRECT_PATH_AFTER_LOGOUT`.

You may want to create your own `User` model. If yes, then you must extend `Autisid\OIDCClient\User` in order to get auth working.

Check your `auth.providers.users.model` config value: it must be set to your custom `User` model or to `Autisid\OIDCClient\User` instead.

---

> Originally developed by Cabinet Office Digital Development in October 2019.
>
> Currently maintained by [maicol07](https://maicol07.it) from October 2021
>
> Modified by [autisid](https://autisid.it) in Februari 2023

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

1246d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/057e49c704ab9dc13ac3fe84ab050c5c53f5dde66679e6504cfa8d2b78bd70d6?d=identicon)[autisid](/maintainers/autisid)

### Embed Badge

![Health badge](/badges/autisid-laravel-oidc-client/health.svg)

```
[![Health](https://phpackages.com/badges/autisid-laravel-oidc-client/health.svg)](https://phpackages.com/packages/autisid-laravel-oidc-client)
```

###  Alternatives

[kartik-v/yii2-password

Useful password strength validation utilities for Yii Framework 2.0

761.3M17](/packages/kartik-v-yii2-password)[vitalybaev/laravel5-dkim

Laravel 5/6 package for signing outgoing messages with DKIM.

3163.1k](/packages/vitalybaev-laravel5-dkim)

PHPackages © 2026

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