A rudimentary YOURLS plugin to enable Central Authentication Service for user authentication.
- Extract the latest release of phpCAS to a location php can access.
- In
user/plugins
create a new folder namedcas-auth
. - Extract the latest release of yourls-cas-auth to that folder.
- Provide connection details and a user white list to
user/config.php
. (details below) - Go to your Plugins administration page and activate the CAS Authentication plugin
When enabled and configured properly this plugin will essentially hijack YOURLS default handling of login/logout, redirecting such requests to your CAS server.
At minimum you must define the following:
-
CASAUTH_CAS_PATH
The path to where you extracted phpCAS.This should be an absolute path, though there is a weak attempt at accepting a relative path.
-
CASAUTH_CAS_HOST
The hostname of your CAS server.eg
cas.server.com
-
CASAUTH_CAS_URI
The URI your CAS server is responding on.eg
/cas
Additionally you may also define the following:
-
CASAUTH_CAS_VERSION
The version of your CAS server.Defaults to
CAS_VERSION_2_0
as defined by phpCAS -
CASAUTH_CAS_PORT
The port your CAS server is running on.Defaults to
443
-
CASAUTH_CAS_CACERT
The PEM certificate file name of the CA that emited the cert of the server.You should set this, otherwise the plugin will attempt to connect to CAS with out server validation.
-
$casauth_user_whitelist
An array of authenticated usernames permitted to administer the site.If omitted or empty all authenticated usernames are permitted to administer the site.
`$casauth_user_whitelist = array( 'user-one' 'user-two' ... );`
- Double check your configuration in
user/config.php
. - Run around in a circle while crying "The sky is falling!"
- Check the issue queue.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.