SESAME#
The way in. One lock, any key. Single Entry, Sessions App-Managed Everywhere: keys cut while you wait, and no key ever gets to keep the door.
SESAME is Wayne State's protocol-neutral auth library. It returns a verified
identity and leaves the session to the app: every driver ends in the same
place, the app's findOrImportUser(Identity), and the protocol never holds
the session. Switching driver is a config change with no code change. Open
sesame.
Where the code lives#
The canonical repository is enterprise-apps/sesame on git.wayne.edu; issues and merge requests open there, and tags are made there, by the maintainer, with an approver. GitHub (waynestate/sesame) is a read-only push mirror; nobody pushes to it, and Packagist reads from it. CI runs on git.wayne.edu.
Install#
composer require waynestate/sesame
First use#
The quickest way to see it work is the fake driver in local development: no
server to point at, no registration to make.
<?php
declare(strict_types=1);
require __DIR__.'/vendor/autoload.php';
use Waynestate\Sesame\Config;
use Waynestate\Sesame\DriverFactory;
use Waynestate\Sesame\Identity;
use Waynestate\Sesame\Sesame;
use Waynestate\Sesame\Session\NativeSession;
use Waynestate\Sesame\UserResolver;
// Or call helmet_boot(), which sets all of this. NativeSession warns without it.
ini_set('session.use_strict_mode', '1');
session_set_cookie_params(['httponly' => true, 'secure' => true, 'samesite' => 'Lax']);
session_start();
$config = Config::fromArray([
'driver' => 'fake',
'environment' => 'local',
'fake' => [
'username' => 'jdoe',
'attributes' => ['cn' => ['John Doe']],
],
]);
$sesame = new Sesame(
DriverFactory::make($config),
new class implements UserResolver {
public function findOrImportUser(Identity $identity): mixed
{
return $identity->username;
}
},
new NativeSession(),
$config,
);
sesame($sesame);
// When the login has not completed, sends the redirect to the identity
// provider and stops the script. When a ticket completes it, sends the
// redirect to the driver's service URL and stops the script, so the ticket
// never stays in the address bar. When the user is already signed in and
// the request has no ticket, returns the user.
$user = sesame_login();
Every piece named, and what the app owns and what SESAME does: Raw PHP.
Pick your path#
- Quick start: sign a user in from scratch, one step at a time.
- Install: what SESAME needs, the composer line, and how to prove it took.
- Reference: the drivers, the configuration, the API, and the proof.
Status: version 0.8.0, MIT license. The changelog's top heading is [Unreleased].
Agents: read llms.txt first; it maps these docs for language models.
