As a
Network Administrator
I want
the SAML SSO plugin to work seamlessly with pressbooks-microcredentials for single sign-on authentication
So that
users from institutions with SAML/Shibboleth identity providers can authenticate once and access microcredential content without separate login credentials, maintaining the same SSO experience they have with Pressbooks
Context
Current Analysis:
Based on initial investigation, the SAML SSO plugin should work with minimal or no changes for Microcredentials because:
What Needs Verification:
- Confirm SAML works on MC sites without Pressbooks core
- Remove/replace any Pressbooks\Container dependencies
- Test end-to-end authentication flow
- Define role mapping for MC context
- Document configuration for MC networks
SAML Plugin Architecture:
| Component |
Purpose |
| SAML class |
Core authentication flow using OneLogin PHP SAML Toolkit |
| Admin class |
Network admin settings page for IdP configuration |
| User matching |
Match by pressbooks_saml_identity user meta → fallback to email |
| Provisioning |
refuse (deny new users) or create (auto-register) |
Authentication Flow:
1. User clicks "Connect via SAML2" on wp-login.php
└── Redirect to IdP with AuthnRequest
2. IdP authenticates user, returns SAML assertion
└── POST to /wp-login.php?action=pb_shibboleth_acs
3. Plugin parses assertion, extracts attributes:
└── uid (urn:oid:0.9.2342.19200300.100.1.1)
└── mail (urn:oid:0.9.2342.19200300.100.1.3)
└── eduPersonPrincipalName (optional fallback)
4. Match user:
└── Check user_meta `pressbooks_saml_identity` = "{net_id}|timestamp"
└── If not found, try email match
└── If not found, create or refuse based on config
5. Login user via programmatic_login()
└── Redirect to original page (tracked in $_SESSION)
Acceptance Criteria
Compatibility Verification
Authentication Flow
User Provisioning
Role Mapping
Multi-site Behavior
Code Changes (if needed)
Documentation
Out of Scope
- LTI-initiated SAML authentication (separate consideration)
- Multiple IdP support per network
- Custom attribute mapping UI
- SAML-based authorization (beyond authentication)
- IdP-initiated SSO (if not currently supported)
Technical Notes
Key Config Options:
| Option |
Values |
Description |
| idp_entity_id |
URL |
Identity Provider Entity ID |
| idp_sso_login_url |
URL |
IdP SSO endpoint |
| idp_x509_cert |
PEM cert |
IdP signing certificate |
| provision |
refuse / create |
New user handling |
| bypass |
bool |
Skip WordPress signup validation |
| forced_redirection |
bool |
All logins go through SAML |
Key Hooks/Filters:
| Hook |
Location |
Purpose |
| pb_saml_auth_settings |
SAML class |
Modify OneLogin settings array |
| pb_integrations_multidomain_email |
SAML class |
Transform email before matching |
| authenticate |
WordPress |
Main entry point for SAML auth |
Potential Code Changes:
// Before (if using Pressbooks Container)
$service = \Pressbooks\Container::get('SomeService');
// After (using app() helper)
$service = app('SomeService');
// Or if service doesn't exist in MC container, handle gracefully
Role Mapping Considerations:
// MC-specific roles to consider
// - mc_author: Can create/edit own MC content
// - mc_editor: Can edit any MC content
// - subscriber: Can view/complete MCs (learner)
// - administrator: Full site access
// Possible SAML attribute mapping
$role_map = [
'faculty' => 'mc_author',
'staff' => 'mc_editor',
'student' => 'subscriber',
];
Test IdP Setup:
- Auth0 SAML configuration (pending access)
- Local SimpleSAMLphp for development testing
- Test assertions with various attribute formats
Design/Mockups
No UI changes expected - using existing SAML plugin admin interface
If role mapping UI is needed:
Dependencies
Testing Notes
Test Environment Setup
- Configure test IdP (Auth0 or SimpleSAMLphp)
- Configure SAML plugin with test IdP
- Create test users in IdP
- Test on MC network (not Pressbooks network)
Manual Testing Scenarios
Authentication:
- Access MC site while logged out
- Click "Connect via SAML2"
- Authenticate at IdP
- Verify redirect back and logged in
- Verify user meta set correctly
User Matching:
- Login with user that has
pressbooks_saml_identity meta
- Login with user matched by email only
- Login with new user (provisioning=create)
- Login with new user (provisioning=refuse)
Definition of Done
Risk Assessment
| Risk |
Likelihood |
Impact |
Mitigation |
| Hidden PB dependencies |
Low |
Medium |
Thorough code review |
| OneLogin library compatibility |
Low |
High |
Test early |
| Role mapping complexity |
Medium |
Medium |
Start simple, iterate |
| IdP configuration variance |
Medium |
Low |
Good documentation |
As a
Network Administrator
I want
the SAML SSO plugin to work seamlessly with pressbooks-microcredentials for single sign-on authentication
So that
users from institutions with SAML/Shibboleth identity providers can authenticate once and access microcredential content without separate login credentials, maintaining the same SSO experience they have with Pressbooks
Context
Current Analysis:
Based on initial investigation, the SAML SSO plugin should work with minimal or no changes for Microcredentials because:
pressbooks_saml_identityuser metaIn fact, we did a quick PoC and it worked locally, see demo here.
We also need to review points mentioned here: https://docs.google.com/document/d/1K-pQf1shTyCqCI4MlLUf1v3hU8xIXgWbTK_nmioY--E/edit?tab=t.0#heading=h.7dntw8cumy21
What Needs Verification:
SAML Plugin Architecture:
pressbooks_saml_identityuser meta → fallback to emailAuthentication Flow:
Acceptance Criteria
Compatibility Verification
Authentication Flow
User Provisioning
pressbooks_saml_identitymetapressbooks_saml_identitymeta set on new usersRole Mapping
Multi-site Behavior
Code Changes (if needed)
Pressbooks\Containerwithapp()helperprogrammatic_login()for exampleDocumentation
Out of Scope
Technical Notes
Key Config Options:
Key Hooks/Filters:
Potential Code Changes:
Role Mapping Considerations:
Test IdP Setup:
Design/Mockups
No UI changes expected - using existing SAML plugin admin interface
If role mapping UI is needed:
Dependencies
Testing Notes
Test Environment Setup
Manual Testing Scenarios
Authentication:
User Matching:
pressbooks_saml_identitymetaDefinition of Done
Risk Assessment