2019-04-25 04:52:08 +07:00
|
|
|
package handlers
|
|
|
|
|
|
|
|
// TOTPRegistrationAction is the string representation of the action for which the token has been produced.
|
|
|
|
const TOTPRegistrationAction = "RegisterTOTPDevice"
|
|
|
|
|
|
|
|
// U2FRegistrationAction is the string representation of the action for which the token has been produced.
|
|
|
|
const U2FRegistrationAction = "RegisterU2FDevice"
|
|
|
|
|
|
|
|
// ResetPasswordAction is the string representation of the action for which the token has been produced.
|
|
|
|
const ResetPasswordAction = "ResetPassword"
|
|
|
|
|
|
|
|
const authPrefix = "Basic "
|
|
|
|
|
2020-04-21 04:03:38 +07:00
|
|
|
// AuthorizationHeader is the basic-auth HTTP header Authelia utilises.
|
2020-02-06 09:24:25 +07:00
|
|
|
const AuthorizationHeader = "Proxy-Authorization"
|
2020-12-02 06:03:44 +07:00
|
|
|
|
|
|
|
// SessionUsernameHeader is used as additional protection to validate a user for things like pam_exec.
|
|
|
|
const SessionUsernameHeader = "Session-Username"
|
|
|
|
|
2019-04-25 04:52:08 +07:00
|
|
|
const remoteUserHeader = "Remote-User"
|
2020-10-26 18:38:08 +07:00
|
|
|
const remoteNameHeader = "Remote-Name"
|
|
|
|
const remoteEmailHeader = "Remote-Email"
|
2019-04-25 04:52:08 +07:00
|
|
|
const remoteGroupsHeader = "Remote-Groups"
|
|
|
|
|
|
|
|
var protoHostSeparator = []byte("://")
|
|
|
|
|
|
|
|
const (
|
2020-04-21 04:03:38 +07:00
|
|
|
// Forbidden means the user is forbidden the access to a resource.
|
2019-04-25 04:52:08 +07:00
|
|
|
Forbidden authorizationMatching = iota
|
|
|
|
// NotAuthorized means the user can access the resource with more permissions.
|
|
|
|
NotAuthorized authorizationMatching = iota
|
|
|
|
// Authorized means the user is authorized given her current permissions.
|
|
|
|
Authorized authorizationMatching = iota
|
|
|
|
)
|
|
|
|
|
|
|
|
const operationFailedMessage = "Operation failed."
|
|
|
|
const authenticationFailedMessage = "Authentication failed. Check your credentials."
|
|
|
|
const userBannedMessage = "Please retry in a few minutes."
|
2020-04-11 10:54:18 +07:00
|
|
|
const unableToRegisterOneTimePasswordMessage = "Unable to set up one-time passwords." //nolint:gosec
|
2019-04-25 04:52:08 +07:00
|
|
|
const unableToRegisterSecurityKeyMessage = "Unable to register your security key."
|
|
|
|
const unableToResetPasswordMessage = "Unable to reset your password."
|
|
|
|
const mfaValidationFailedMessage = "Authentication failed, please retry later."
|
2020-05-02 23:20:40 +07:00
|
|
|
|
2020-12-16 08:30:03 +07:00
|
|
|
const ldapPasswordComplexityCode = "0000052D."
|
|
|
|
|
|
|
|
var ldapPasswordComplexityCodes = []string{"0000052D"}
|
|
|
|
var ldapPasswordComplexityErrors = []string{"LDAP Result Code 19 \"Constraint Violation\": Password fails quality checking policy"}
|
2020-11-27 16:59:22 +07:00
|
|
|
|
2020-05-02 23:20:40 +07:00
|
|
|
const testInactivity = "10"
|
|
|
|
const testRedirectionURL = "http://redirection.local"
|
|
|
|
const testResultAllow = "allow"
|
|
|
|
const testUsername = "john"
|
2020-05-21 05:03:15 +07:00
|
|
|
|
|
|
|
const movingAverageWindow = 10
|
|
|
|
const msMinimumDelay1FA = float64(250)
|
|
|
|
const msMaximumRandomDelay = int64(85)
|