cas-server-auth-json

A simple authentication plugin for cas-server that uses a JSON credential store

Usage no npm install needed!

<script type="module">
  import casServerAuthJson from 'https://cdn.skypack.dev/cas-server-auth-json';
</script>

README

cas-server-auth-json

This module provides a simple reference implementation of an authentication plugin for cas-server. The plugin reads a JSON file and uses the parsed data to validate credentials.

Example JSON data file:

{
  "luser": {
    "password": "123456",
    "firstName": "Local",
    "lastName": "User"
  }
}

Keys on the parent object represent usernames. The only required property of a user object is the password property. Any other properties will be returned as extra attributes in a CAS 3.0 service validation response.

When the plugin is initialized it can be passed a configuration object that specifies the data file:

{
  credentialStore: '/path/to/data.json'
}

Note: the data file must have a .json extention. Otherwise it will not be parsed correctly. Also, if you do not supply a file the plugin will default to using the included store.example.json file.