worteks / yii2auth-oidc
OIDC connector for yii2-authclient
Installs: 11 389
Dependents: 1
Suggesters: 0
Security: 0
Stars: 4
Watchers: 2
Forks: 0
Open Issues: 2
Requires
- yiisoft/yii2-authclient: ~2.1
This package is auto-updated.
Last update: 2025-03-10 22:28:21 UTC
README
This extension adds OIDC support for yii2-authclient.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require worteks/yii2auth-oidc
or add
"worteks/yii2auth-oidc": "~0.2"
to the require
section of your composer.json.
Usage
You must read the yii2-authclient docs
Set up an OpenID Provider (OP) and configure your Yii2 app as a Relying Party (RP) on your Authentication Server.
Example application configuration:
'components' => [ 'authClientCollection' => [ 'clients' => [ // ... 'oidc' => [ 'class' => 'worteks\yii\authclient\OIDC', 'domain' => 'https://auth.example.com', 'clientId' => 'myClientId', 'clientSecret' => 'myClientSecret', ], ], // ... ]
Configuration | Mandatory | Default to | Description |
---|---|---|---|
domain | yes | URL of your authentication server | |
clientId | yes | Your client id | |
clientSecret | yes | Your client secret | |
authUrl | no | '/oauth2/authorize' | Authorization Endpoint |
tokenUrl | no | '/oauth2/token' | Token Endpoint |
apiBaseUrl | no | '/oauth2' | Base for Userinfo Endpoint |
userInfoUrl | no | 'userinfo' | Userinfo Endpoint |
scope | yes | 'openid profile email' | What access privileges are being requested |
defaultName | no | Yii auth client id | Auth service name to use in DB record, CSS |
defaultTitle | no | Yii auth client id | Auth service title to display in views |