Go SDK for AuthGate. Requires Go 1.25+.
go get github.com/go-authgate/sdk-go| Package | Description |
|---|---|
| credstore | Secure credential storage with OS keyring integration and file-based fallback |
| oauth | OAuth 2.0 token client (Device Code, Auth Code, Client Credentials, Refresh, Revoke, Introspect, UserInfo) |
| discovery | OIDC auto-discovery from /.well-known/openid-configuration with caching |
| authflow | CLI flow orchestration (Device Code polling, Auth Code + PKCE, auto-refresh TokenSource with persistent storage) |
| middleware | net/http Bearer token validation middleware with BearerAuth and RequireScope (any Go HTTP framework) |
| clientcreds | Thread-safe Client Credentials token source with auto-cache, HTTPClient() and RoundTripper() for M2M |
credstore (storage) discovery (OIDC endpoint URLs)
| \ |
| \ v
| +----> oauth <---+
| / | \
| / | \
v v v v
+------> authflow middleware clientcreds# Run tests
make test
# Run linter
make lint
# Format code
make fmtSee the LICENSE file for details.