package
0.5.0
Repository: https://github.com/fmitra/authenticator.git
Documentation: pkg.go.dev

# Functions

NewService returns a new TokenService.
WithCookieDomain configures the service with the domain for a secure cookie.
WithCookieMaxAge sets the max age for an HTTP cookie.
WithDB configures the service with a redis DB.
WithIssuer is the issuer identity for the JWT token.
WithLogger configures the service with a logger.
WithOTP configures the service with an OTP management service.
WithOTPAddress sets an address to receive a randomly generated OTP code.
WithOTPDeliveryMethod sets a delivery method (e.g.
WithRefreshableToken uses an older JWT token as a basis for creating a new token.
WithRefreshTokenExpiry defines how long a refresh token is valid for.
WithRepoManager configures the service with a new RepositoryManager.
WithSecret configures the service with a secret value for signing functions.
WithTokenExpiry defines how long tokens are valid for.

# Constants

ClientIDCookie is the cookie name used to set the token's ClientID value on a client.
RefreshTokenCookie is the cookie name used to set the refresh token value on a client.

# Structs

RefreshToken is a token capable of refreshing an expired JWT token.
Response ensures consistent formatting for JSON APIs.

# Type aliases

ConfigOption configures the service.