- PHP 80.2%
- Shell 18%
- Blade 1.8%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .pi/plans | ||
| config | ||
| database/migrations | ||
| lang | ||
| resources/views | ||
| scripts | ||
| src | ||
| tests/Unit | ||
| .gitignore | ||
| composer.json | ||
| LICENSE | ||
| phpunit.xml | ||
| plugin.json | ||
| README.md | ||
| update.json | ||
Features
- OIDC Discovery from one configurable HTTPS issuer
- Authorization Code flow with state, nonce and PKCE S256
- mandatory ID-token signature, issuer, audience, time and nonce validation
- scopes
openid profile email groups - automatic Pelican account provisioning
- linking to an existing account only when the provider returns the boolean claim
email_verified: true - optional synchronization of one Authelia group to Pelican's Root Admin role
- preferred OIDC login with a documented local emergency login
- encrypted client ID and client secret using Pelican's
APP_KEY - native Pelican update manifest and Gitea release scripts
The plugin uses Pelican's OAuth extension and does not modify core files.
Requirements
- Pelican Panel
1.0.0-beta36or newer - PHP 8.3–8.5
- an externally reachable HTTPS URL for Pelican and Authelia
- working Pelican queue worker for plugin installation/update jobs
Installation
- Build or download
pelican-extended-oidc.zip. - Open Admin → Plugins → Import from file in Pelican.
- Upload and install the archive. Pelican installs
kovah/laravel-socialite-oidcautomatically. - Enable the plugin, then open its Settings action.
- Enter issuer, client ID, client secret and optionally the admin group.
CLI fallback inside the panel container:
cd /var/www/html
php artisan p:plugin:install pelican-extended-oidc
php artisan optimize:clear
Callback URL
Register this exact redirect URI in Authelia, replacing the host with the public Pelican URL:
https://panel.example.com/auth/oauth/callback/generic-oidc
APP_URL and trusted proxy settings must represent the external HTTPS URL. Otherwise Pelican may generate an unusable callback URL.
Authelia client example
The exact structure can vary between Authelia versions. The relevant client options are:
identity_providers:
oidc:
clients:
- client_id: pelican
client_name: Pelican Panel
client_secret: '$pbkdf2-sha512$...'
public: false
authorization_policy: two_factor
require_pkce: true
pkce_challenge_method: S256
token_endpoint_auth_method: client_secret_basic
redirect_uris:
- https://panel.example.com/auth/oauth/callback/generic-oidc
scopes:
- openid
- profile
- email
- groups
response_types:
- code
grant_types:
- authorization_code
Generate and retain the original plaintext secret before putting its hash into Authelia. Enter that plaintext secret only in Pelican's plugin settings. Never commit or send it in support messages.
The issuer entered in Pelican must exactly match the issuer returned by:
https://auth.example.com/.well-known/openid-configuration
Account and claim behavior
- Stable identity: SHA-256 of exact issuer plus
sub, stored through Pelican's existingusers.oauthmapping. - Required claims: non-empty
sub,email, and booleanemail_verified: truefor first provisioning/linking. - Username:
preferred_username, thennickname, then the local part of the email. Collisions receive a numeric suffix. - Tokens and full claims are not persisted.
- Changing the issuer after users have linked creates a different identity namespace and may require relinking.
Existing email addresses
An unlinked Pelican account with the same normalized email is linked automatically only when Authelia returns the literal JSON boolean true for email_verified. This protects against account takeover through an unverified email claim. Ensure only trusted administrators can change Authelia claims and client mappings.
Admin group
If an admin group is configured, exact case-sensitive membership in the groups array grants Pelican's Root Admin role on login. The plugin records only roles it granted itself:
- removing the group removes only a plugin-managed Root Admin grant;
- an existing locally assigned Root Admin is never marked as plugin-managed;
- the last Root Admin is not removed, to prevent total panel lockout;
- an empty admin-group setting disables synchronization.
Use a dedicated Authelia group such as pelican-admins and protect its membership carefully.
Preferred login and emergency access
When Show only OIDC by default is enabled, the normal login page displays external authentication only. It also provides a Sign in with a local account button which opens Pelican's password form. The local form links back to the OIDC-only page.
Local emergency login is also directly available at:
https://panel.example.com/login?local=1
Keep at least one tested local Root Admin credential in secure storage. The plugin hides the password form on the default login request but does not disable local authentication globally.
Security design
- Discovery, token, user-info and JWKS endpoints must use HTTPS.
- Discovery's
issuermust exactly match the configured issuer. - Only asymmetric algorithms announced by discovery are accepted;
noneand HMAC algorithms are rejected. - JWKS are cached for one hour; requests use bounded timeouts and at most three redirects.
- State is handled by Laravel Socialite; nonce is one-time and PKCE uses S256.
- Confidential clients authenticate at the token endpoint with
client_secret_basic; the secret is never sent as a form field. - ID tokens are checked for signature,
iss,aud, multi-audienceazp,exp,iat, optionalnbf, nonce and subject. - The client secret is encrypted at rest with
APP_KEY. Back up that key; changing it without migration makes the secret unreadable.
Development
Build the installable archive:
./scripts/build-plugin-zip.sh
The archive is written to dist/pelican-extended-oidc.zip and contains one top-level pelican-extended-oidc/ directory.
Releases and updates
plugin.json points Pelican to update.json. Pelican uses that manifest to display and install newer versions. The plugin also adds Check for updates to plugin rows, matching the reference plugin behavior.
The release script targets the Gitea-compatible repository URL from plugin.json:
read -rsp 'Gitea token: ' GITEA_TOKEN && export GITEA_TOKEN
./scripts/release.sh
unset GITEA_TOKEN
It validates repository access, synchronizes update.json, builds the ZIP, verifies the remote branch, asks for confirmation, commits and pushes all pending changes, creates tag/release vX.Y.Z, and uploads the archive. Use --yes to skip confirmation. All pending repository changes are included in the release commit.
Backup and removal
Back up Pelican's database and APP_KEY before updates. Uninstalling rolls back the plugin settings and admin-grant marker tables. Pelican's existing users.oauth key for generic-oidc may remain in user JSON; remove those mappings manually before reinstalling with a different identity source if required.
License
AGPL-3.0-only. See LICENSE.