Documentation
¶
Overview ¶
Package main demonstrates the OAuth plugin with a complete example server.
This example shows: - Setting up an OAuth authorization server - Registering OAuth clients - Protecting endpoints with OAuth scopes - Using the authorization code flow
To test: 1. Run: go run ./examples/oauthserver 2. Visit: http://localhost:8080 3. Click "Start OAuth Flow" to test the authorization code flow 4. Or use curl to test the client credentials flow:
curl -X POST http://localhost:8080/oauth/token \ -d "grant_type=client_credentials" \ -d "client_id=demo-client" \ -d "client_secret=demo-secret" \ -d "scope=read"
Click to show internal directories.
Click to hide internal directories.