OpenID Connect Authentication for YOURLS
This plugin enables authentication against a generic OpenID Connect server in YOURLS.
sub
, sets display name to preferred_username
composer
, php-curl
, php-xml
, and php-json
oidc
folder into YOURLS/user/plugins/
cd
to the directory you just createdcomposer install
in that directory to fetch the OIDC libraryConfig: user/config.php
file.
// oidc server
define( 'OIDC_BASE_URL', 'https://keycloak.example.com/auth/realms/master/' );
define( 'OIDC_CLIENT_NAME', 'YOURLS' );
define( 'OIDC_CLIENT_SECRET', 'YOUR-SUPER-SECRET-HASH' );
// Option 1: link OIDC users to local YOURLS users
$oidc_profiles = array(
'YOURLS_UNAME' => 'sub attribute from OIDC provider',
);
// Option 2, all users on OIDC platform have YOURLS accounts. uses 'preferred_username' attribute
define( 'OIDC_BYPASS_YOURLS_AUTH', true );
Dogecoin: DARhgg9q3HAWYZuN95DKnFonADrSWUimy3
Copyright 2019 Joshua Panter