Complete OAuth 2.0 server for development, testing, and prototyping OAuth authentication
581
A complete OAuth 2.0 server ready to use in a Docker container. Ideal for development, testing, and prototyping applications that require OAuth authentication.
docker run -p 4321:4321 jondotsoy/oauthbin
The server will be available at http://localhost:4321
The container includes a pre-configured OAuth client:
20260104.apps.localhost20260104.secret/api/metricservices:
oauth-provider:
image: jondotsoy/oauthbin
ports:
- "4321:4321"
You can easily test OAuthBin using Postman with the Authorization Code flow:

Configuration steps:
Create a new request in Postman
Go to the Authorization tab
Select OAuth 2.0 as the type
Click Configure New Token and use these values:
https://httpbin.io/gethttp://localhost:4321/authorizehttp://localhost:4321/api/token20260104.apps.localhost20260104.secretphotosample (or any value)Click Get New Access Token
Complete the authorization in the browser
Use the generated token in your requests
1. Get authorization code:
curl "http://localhost:4321/authorize?response_type=code&client_id=20260104.apps.localhost&redirect_uri=https://httpbin.io/get&scope=photo&state=xyz"
2. Complete authorization:
curl -X POST http://localhost:4321/api/complete_authorize \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "client_id=20260104.apps.localhost&redirect_uri=https://httpbin.io/get&scope=photo"
3. Exchange code for token:
curl -X POST http://localhost:4321/api/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=authorization_code&code=YOUR_CODE&redirect_uri=https://httpbin.io/get&client_id=20260104.apps.localhost&client_secret=20260104.secret"
curl -X POST http://localhost:4321/api/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=20260104.apps.localhost&client_secret=20260104.secret&scope=photo"
curl -X POST http://localhost:4321/api/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=password&client_id=20260104.apps.localhost&client_secret=20260104.secret&scope=photo"
curl -X POST http://localhost:4321/api/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=refresh_token&refresh_token=YOUR_REFRESH_TOKEN"
Access metrics in Prometheus format:
curl http://localhost:4321/api/metric
Available metrics:
http_requests_total - Total HTTP requestshttp_request_duration_seconds - Request durationoauth_tokens_generated_total - Tokens generated by typeoauth_auth_codes_generated_total - Authorization codes generatedoauth_errors_total - OAuth errorsscrape_configs:
- job_name: 'oauthbin'
static_configs:
- targets: ['oauth-provider:4321']
metrics_path: '/api/metric'
GET / - Home page with documentationGET /authorize - OAuth authorization endpointPOST /api/complete_authorize - Complete authorizationPOST /api/token - Token endpointGET /api/metric - Prometheus metricsā ļø This server is designed for development and testing. Do not use in production without:
ASTRO_TELEMETRY_DISABLED=1 - Disables Astro telemetry (pre-configured)ASTRO_DB_REMOTE_URL=file:/data/oauthbin.db - Database location (pre-configured)DEV_TOOLBAR_ENABLED=false - Disables Astro dev toolbar (pre-configured)The container uses a volume at /data to persist the OAuth database. To maintain data between container restarts:
docker run -p 4321:4321 -v oauthbin-data:/data jondotsoy/oauthbin
Or with Docker Compose:
services:
oauth-provider:
image: jondotsoy/oauthbin
ports:
- "4321:4321"
volumes:
- oauthbin-data:/data
volumes:
oauthbin-data:
For detailed documentation, advanced examples, and source code: https://github.com/jondotsoy/oauthbinā
https://github.com/jondotsoy/oauthbin/issuesā
MIT License - see LICENSEā file for details
Built with: Astro + Astro DB + Node.js
Content type
Image
Digest
sha256:bff02d90eā¦
Size
108.2 MB
Last updated
9 months ago
docker pull jondotsoy/oauthbin