🔐 PHP OAuth 2.0 Server

A complete, production-ready OAuth 2.0 implementation in PHP

🔑 Authorization Code Grant

Full implementation with PKCE support for secure authorization flows.

🔄 Token Refresh

Automatic token refresh with secure rotation of refresh tokens.

🛡️ PKCE Support

Proof Key for Code Exchange prevents authorization code interception attacks.

📡 Protected API

Bearer token authentication for protected resource endpoints.

Endpoints

EndpointMethodDescription
GET /authorizeGETAuthorization endpoint — displays login & consent
POST /tokenPOSTToken endpoint — exchanges code for tokens
GET /api/userGETProtected resource — returns user profile
POST /revokePOSTRevoke an access or refresh token
▶️ Try the Demo Flow ⚙️ Admin Dashboard

Demo Credentials

Usernameadmin
Passwordpassword
Client IDdemo-client-id
Client Secretdemo-client-secret