type
AuthStrategy
One compiled application-owned request authentication strategy.
Arguments
| Argument | Type | Description |
|---|---|---|
Name | string | A stable lowercase kebab-case identifier used in diagnostics. |
Authenticate | func(AuthStrategyContext) (AuthStrategyResult, | Recognizes and authenticates the request without returning raw credentials or untrusted user data. |
How it works
Strategies run in declaration order after built-in session and API-key authentication. Return Authenticated false when the request does not belong to the strategy.
Full signature
type AuthStrategy struct {
// Name is a stable lowercase kebab-case identifier used in diagnostics.
Name string
// Authenticate returns Authenticated false when the request does not belong
// to this strategy. It must not return raw credentials or untrusted user data.
Authenticate func(AuthStrategyContext) (AuthStrategyResult, error)
}Related types
AuthStrategyContextNormalized request input for a custom authentication strategy.
AuthStrategyResultResult of one custom authentication strategy.