Configuration Guide
Config Struct
type Config struct {
// Required
Provider string // "hmac", "okta", "google", "azure"
// Provider-specific
Issuer string // OIDC issuer URL (Okta/Google/Azure) - validated for HTTPS
JWTSecret []byte // Secret key (HMAC only)
Audience string // Your API audience
// Optional - OAuth Mode
Mode string // "native" or "proxy" - auto-detected from ClientID presence
// Optional - Proxy Mode (server-side OAuth flow)
ClientID string // OAuth client ID (triggers proxy mode)
ClientSecret string // OAuth client secret
ServerURL string // Your server's public URL
RedirectURIs string // Allowed redirect URIs (comma-separated allowlist)
// Optional - Fixed Redirect Mode (for mcp-remote)
FixedRedirectURI string // Single fixed redirect URI for proxying callbacks
AllowedClientRedirectDomains string // Comma-separated domain suffixes allowed for client redirects
// Optional - Token Validation
Scopes []string // OAuth scopes
SkipAudienceCheck bool // Skip audience validation (not recommended)
// Optional - Logging
Logger Logger // Custom logger implementation
}Key Configuration Notes
Configuration Methods
Direct Config
ConfigBuilder (v0.2.0+)
FromEnv() (v0.2.0+)
Required Fields
Provider
Audience
Provider-Specific Fields
Issuer
JWTSecret
OAuth Mode
Mode
Native Mode
Proxy Mode
Native
Proxy
Proxy Mode Fields
ClientID
ClientSecret
ServerURL
RedirectURIs
Optional Fields
Logger
Validation
Validation Rules
Complete Examples
HMAC (Testing)
Okta (Native - Recommended)
Okta (Proxy - For Simple Clients)
Google
Azure AD
Environment Variables Pattern
See Also
Last updated
Was this helpful?