How To Use
Quick Start Guide
Get CAS Single Sign-On running and integrate your first application in under 10 minutes.
10 minutes
Beginner
No prerequisites
1
Install CAS Server
Clone the repository and install dependencies:
Terminal
# Clone the repository
git clone https://github.com/your-org/cas-system.git
cd cas-system
# Install PHP dependencies
composer install
# Install frontend dependencies
npm install && npm run build
2
Configure Environment
Copy the environment file and set your configuration:
Terminal
cp .env.example .env
php artisan key:generate
.env
# Database
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=cas_system
DB_USERNAME=your_db_user
DB_PASSWORD=your_db_password
# Redis (optional, recommended for sessions)
CACHE_DRIVER=redis
SESSION_DRIVER=redis
# reCAPTCHA (optional)
RECAPTCHA_SITE_KEY=your_recaptcha_key
RECAPTCHA_SECRET_KEY=your_recaptcha_secret
3
Run Migrations
Create the database tables and seed initial data:
php artisan migrate --seed
This creates: users, client_systems, sso_tokens, audit_logs, ip_whitelists, and more.
4
Create Admin Account
Register your first admin user. Start the server first:
php artisan serve --port=8000
Then navigate to http://localhost:8000/auth/register and create your account. The first user registered is automatically assigned the admin role.
Important: Only the first registered user gets admin privileges. Subsequent users are created as regular users.
5
Register a Client Application
Go to the Admin Panel and register your first client application:
- a Navigate to Admin Panel → Client Systems → Add New
- b Enter your application name, URL, and callback URL
-
c
Save — the system auto-generates
client_id,client_secret,client_username, andclient_password - d Copy these credentials immediately — the secret/password are only shown once
Add your client IP to the IP whitelist from Admin → IP Whitelist so the CAS server accepts your requests.
6
Test SSO Authentication
Use cURL to test your first SSO token exchange:
POST
/api/sso/token
curl -X POST http://localhost:8000/api/sso/token \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"password": "your_password",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET"
}'
On success, you'll receive a JWT token:
Response
{
"success": true,
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": 1,
"name": "Admin User",
"email": "[email protected]",
"role": "admin"
}
}