2019-04-24 21:52:08 +00:00
|
|
|
package schema
|
|
|
|
|
|
|
|
// TOTPConfiguration represents the configuration related to TOTP options.
|
|
|
|
type TOTPConfiguration struct {
|
2023-02-13 20:39:46 +00:00
|
|
|
Disable bool `koanf:"disable"`
|
|
|
|
Issuer string `koanf:"issuer"`
|
|
|
|
DefaultAlgorithm string `koanf:"algorithm"`
|
|
|
|
DefaultDigits int `koanf:"digits"`
|
|
|
|
DefaultPeriod int `koanf:"period"`
|
|
|
|
Skew *int `koanf:"skew"`
|
|
|
|
SecretSize int `koanf:"secret_size"`
|
|
|
|
|
|
|
|
AllowedAlgorithms []string `koanf:"allowed_algorithms"`
|
|
|
|
AllowedDigits []int `koanf:"allowed_digits"`
|
|
|
|
AllowedPeriods []int `koanf:"allowed_periods"`
|
2019-04-24 21:52:08 +00:00
|
|
|
}
|
2020-04-05 12:37:21 +00:00
|
|
|
|
2023-02-13 20:39:46 +00:00
|
|
|
var defaultTOTPSkew = 1
|
2020-04-20 21:03:38 +00:00
|
|
|
|
|
|
|
// DefaultTOTPConfiguration represents default configuration parameters for TOTP generation.
|
2020-04-05 12:37:21 +00:00
|
|
|
var DefaultTOTPConfiguration = TOTPConfiguration{
|
2023-02-13 20:39:46 +00:00
|
|
|
Issuer: "Authelia",
|
|
|
|
DefaultAlgorithm: TOTPAlgorithmSHA1,
|
|
|
|
DefaultDigits: 6,
|
|
|
|
DefaultPeriod: 30,
|
|
|
|
Skew: &defaultTOTPSkew,
|
|
|
|
SecretSize: TOTPSecretSizeDefault,
|
2020-04-05 12:37:21 +00:00
|
|
|
}
|