A first-party OAuth2 authorization server package for the Adele Go framework. Implements RFC 6749 (OAuth 2.0 Authorization Framework), RFC 6750 (Bearer Token Usage), and RFC 7636 (PKCE) compliant flows. Ships as an Adele ServiceProvider with automatic route registration, bearer token middleware, and scope-based access control. Supports authorization code (with and without PKCE), client credentials, and password grants.
| Grant Type | Client Type | Flow | Use Case |
|---|---|---|---|
authorization_code |
plain |
Server-side apps with secure secret storage | Web apps |
authorization_code |
pkce |
Public clients (SPAs, mobile, native apps) | Browser/mobile |
authorization_code |
pkce_implicit |
Public clients, no user consent, short-lived tokens | Limited-scope browser widgets |
client_credentials |
— | Machine-to-machine, no user context | Service accounts |
password |
— | Trusted first-party apps with direct credential access | Legacy/internal tools |
go get github.com/cidekar/adele-oauth2Blank-import the package to auto-register the ServiceProvider:
import (
_ "github.com/cidekar/adele-oauth2"
)The ServiceProvider automatically registers:
GET /oauth/authorize— authorization request (renders consent)POST /oauth/authorize— authorization grant exchangePOST /oauth/token— token exchangePOST /oauth/token/refresh— refresh token exchangeGET /api/ping— test endpoint for bearer middleware validation
Optional provider configuration:
app.Provider.SetProviderConfig("oauth", map[string]interface{}{
"guarded_route_groups": []string{"/api"},
"scopes": map[string]string{
"read": "Read access",
"write": "Write access",
},
})For complete documentation including installation, configuration, scopes, middleware, and client management, see the full documentation.
Copyright 2025 Cidekar, LLC. All rights reserved.
