Documentation ¶
Index ¶
- Constants
- Variables
- type DefaultFormLoginController
- func (c *DefaultFormLoginController) LoginForm(ctx context.Context, r *LoginRequest) (*template.ModelView, error)
- func (c *DefaultFormLoginController) Mappings() []web.Mapping
- func (c *DefaultFormLoginController) OtpVerificationForm(ctx context.Context, r *OTPVerificationRequest) (*template.ModelView, error)
- type DefaultFormLoginPageOptions
- type FormAuthMWOptions
- type FormAuthMWOptionsFunc
- type FormAuthenticationMiddleware
- type FormLoginConfigurer
- type FormLoginFeature
- func (f *FormLoginFeature) EnableMFA() *FormLoginFeature
- func (f *FormLoginFeature) FailureHandler(failureHandler security.AuthenticationErrorHandler) *FormLoginFeature
- func (f *FormLoginFeature) Identifier() security.FeatureIdentifier
- func (f *FormLoginFeature) LoginErrorUrl(loginErrorUrl string) *FormLoginFeature
- func (f *FormLoginFeature) LoginProcessUrl(loginProcessUrl string) *FormLoginFeature
- func (f *FormLoginFeature) LoginUrl(loginUrl string) *FormLoginFeature
- func (f *FormLoginFeature) MfaErrorUrl(mfaErrorUrl string) *FormLoginFeature
- func (f *FormLoginFeature) MfaRefreshUrl(mfaRefreshUrl string) *FormLoginFeature
- func (f *FormLoginFeature) MfaUrl(mfaUrl string) *FormLoginFeature
- func (f *FormLoginFeature) MfaVerifyUrl(mfaVerifyUrl string) *FormLoginFeature
- func (f *FormLoginFeature) OtpParameter(otpParam string) *FormLoginFeature
- func (f *FormLoginFeature) PasswordParameter(passwordParam string) *FormLoginFeature
- func (f *FormLoginFeature) RememberCookieDomain(v string) *FormLoginFeature
- func (f *FormLoginFeature) RememberCookieSecured(v bool) *FormLoginFeature
- func (f *FormLoginFeature) RememberCookieValidity(v time.Duration) *FormLoginFeature
- func (f *FormLoginFeature) RememberParameter(rememberParam string) *FormLoginFeature
- func (f *FormLoginFeature) SuccessHandler(successHandler security.AuthenticationSuccessHandler) *FormLoginFeature
- func (f *FormLoginFeature) UsernameParameter(usernameParam string) *FormLoginFeature
- type LoginRequest
- type MfaAuthenticationMiddleware
- type MfaAwareAuthenticationEntryPoint
- type MfaAwareAuthenticationErrorHandler
- type MfaAwareSuccessHandler
- type MfaMWOptions
- type MfaMWOptionsFunc
- type OTPVerificationRequest
- type PageOptionsFunc
- type RememberUsernameSuccessHandler
Constants ¶
View Source
const ( LoginModelKeyUsernameParam = "usernameParam" LoginModelKeyPasswordParam = "passwordParam" LoginModelKeyLoginProcessUrl = "loginProcessUrl" LoginModelKeyRememberedUsername = "rememberedUsername" LoginModelKeyOtpParam = "otpParam" LoginModelKeyMfaVerifyUrl = "mfaVerifyUrl" LoginModelKeyMfaRefreshUrl = "mfaRefreshUrl" LoginModelKeyMsxVersion = "MSXVersion" )
View Source
const (
CookieKeyRememberedUsername = "RememberedUsername"
)
Variables ¶
View Source
var (
FeatureId = security.FeatureId("FormLogin", security.FeatureOrderFormLogin)
)
View Source
var Module = &bootstrap.Module{ Name: "form login", Precedence: security.MinSecurityPrecedence + 20, Options: []fx.Option{ fx.Invoke(register), }, }
Functions ¶
This section is empty.
Types ¶
type DefaultFormLoginController ¶
type DefaultFormLoginController struct {
// contains filtered or unexported fields
}
func NewDefaultLoginFormController ¶
func NewDefaultLoginFormController(options ...PageOptionsFunc) *DefaultFormLoginController
func (*DefaultFormLoginController) LoginForm ¶
func (c *DefaultFormLoginController) LoginForm(ctx context.Context, r *LoginRequest) (*template.ModelView, error)
func (*DefaultFormLoginController) Mappings ¶
func (c *DefaultFormLoginController) Mappings() []web.Mapping
func (*DefaultFormLoginController) OtpVerificationForm ¶
func (c *DefaultFormLoginController) OtpVerificationForm(ctx context.Context, r *OTPVerificationRequest) (*template.ModelView, error)
type FormAuthMWOptions ¶
type FormAuthMWOptions struct { Authenticator security.Authenticator SuccessHandler security.AuthenticationSuccessHandler UsernameParam string PasswordParam string }
type FormAuthMWOptionsFunc ¶
type FormAuthMWOptionsFunc func(*FormAuthMWOptions)
type FormAuthenticationMiddleware ¶
type FormAuthenticationMiddleware struct {
// contains filtered or unexported fields
}
func NewFormAuthenticationMiddleware ¶
func NewFormAuthenticationMiddleware(optionFuncs ...FormAuthMWOptionsFunc) *FormAuthenticationMiddleware
func (*FormAuthenticationMiddleware) LoginProcessHandlerFunc ¶
func (mw *FormAuthenticationMiddleware) LoginProcessHandlerFunc() gin.HandlerFunc
type FormLoginConfigurer ¶
type FormLoginConfigurer struct {
// contains filtered or unexported fields
}
func (*FormLoginConfigurer) Apply ¶
func (c *FormLoginConfigurer) Apply(feature security.Feature, ws security.WebSecurity) error
type FormLoginFeature ¶
type FormLoginFeature struct {
// contains filtered or unexported fields
}
func Configure ¶
func Configure(ws security.WebSecurity) *FormLoginFeature
func New ¶
func New() *FormLoginFeature
New is Standard security.Feature entrypoint, DSL style. Used with security.WebSecurity
func (*FormLoginFeature) EnableMFA ¶
func (f *FormLoginFeature) EnableMFA() *FormLoginFeature
func (*FormLoginFeature) FailureHandler ¶
func (f *FormLoginFeature) FailureHandler(failureHandler security.AuthenticationErrorHandler) *FormLoginFeature
FailureHandler overrides LoginErrorUrl
func (*FormLoginFeature) Identifier ¶
func (f *FormLoginFeature) Identifier() security.FeatureIdentifier
func (*FormLoginFeature) LoginErrorUrl ¶
func (f *FormLoginFeature) LoginErrorUrl(loginErrorUrl string) *FormLoginFeature
func (*FormLoginFeature) LoginProcessUrl ¶
func (f *FormLoginFeature) LoginProcessUrl(loginProcessUrl string) *FormLoginFeature
func (*FormLoginFeature) LoginUrl ¶
func (f *FormLoginFeature) LoginUrl(loginUrl string) *FormLoginFeature
func (*FormLoginFeature) MfaErrorUrl ¶
func (f *FormLoginFeature) MfaErrorUrl(mfaErrorUrl string) *FormLoginFeature
func (*FormLoginFeature) MfaRefreshUrl ¶
func (f *FormLoginFeature) MfaRefreshUrl(mfaRefreshUrl string) *FormLoginFeature
func (*FormLoginFeature) MfaUrl ¶
func (f *FormLoginFeature) MfaUrl(mfaUrl string) *FormLoginFeature
func (*FormLoginFeature) MfaVerifyUrl ¶
func (f *FormLoginFeature) MfaVerifyUrl(mfaVerifyUrl string) *FormLoginFeature
func (*FormLoginFeature) OtpParameter ¶
func (f *FormLoginFeature) OtpParameter(otpParam string) *FormLoginFeature
func (*FormLoginFeature) PasswordParameter ¶
func (f *FormLoginFeature) PasswordParameter(passwordParam string) *FormLoginFeature
func (*FormLoginFeature) RememberCookieDomain ¶
func (f *FormLoginFeature) RememberCookieDomain(v string) *FormLoginFeature
func (*FormLoginFeature) RememberCookieSecured ¶
func (f *FormLoginFeature) RememberCookieSecured(v bool) *FormLoginFeature
func (*FormLoginFeature) RememberCookieValidity ¶
func (f *FormLoginFeature) RememberCookieValidity(v time.Duration) *FormLoginFeature
func (*FormLoginFeature) RememberParameter ¶
func (f *FormLoginFeature) RememberParameter(rememberParam string) *FormLoginFeature
func (*FormLoginFeature) SuccessHandler ¶
func (f *FormLoginFeature) SuccessHandler(successHandler security.AuthenticationSuccessHandler) *FormLoginFeature
SuccessHandler overrides LoginSuccessUrl
func (*FormLoginFeature) UsernameParameter ¶
func (f *FormLoginFeature) UsernameParameter(usernameParam string) *FormLoginFeature
type LoginRequest ¶
type LoginRequest struct {
Error bool `form:"error"`
}
type MfaAuthenticationMiddleware ¶
type MfaAuthenticationMiddleware struct {
// contains filtered or unexported fields
}
func NewMfaAuthenticationMiddleware ¶
func NewMfaAuthenticationMiddleware(optionFuncs ...MfaMWOptionsFunc) *MfaAuthenticationMiddleware
func (*MfaAuthenticationMiddleware) OtpRefreshHandlerFunc ¶
func (mw *MfaAuthenticationMiddleware) OtpRefreshHandlerFunc() gin.HandlerFunc
func (*MfaAuthenticationMiddleware) OtpVerifyHandlerFunc ¶
func (mw *MfaAuthenticationMiddleware) OtpVerifyHandlerFunc() gin.HandlerFunc
type MfaAwareAuthenticationEntryPoint ¶
type MfaAwareAuthenticationEntryPoint struct {
// contains filtered or unexported fields
}
func (*MfaAwareAuthenticationEntryPoint) Commence ¶
func (h *MfaAwareAuthenticationEntryPoint) Commence(c context.Context, r *http.Request, rw http.ResponseWriter, err error)
type MfaAwareAuthenticationErrorHandler ¶
type MfaAwareAuthenticationErrorHandler struct {
// contains filtered or unexported fields
}
func (*MfaAwareAuthenticationErrorHandler) HandleAuthenticationError ¶
func (h *MfaAwareAuthenticationErrorHandler) HandleAuthenticationError(c context.Context, r *http.Request, rw http.ResponseWriter, err error)
type MfaAwareSuccessHandler ¶
type MfaAwareSuccessHandler struct {
// contains filtered or unexported fields
}
func (*MfaAwareSuccessHandler) HandleAuthenticationSuccess ¶
func (h *MfaAwareSuccessHandler) HandleAuthenticationSuccess( c context.Context, r *http.Request, rw http.ResponseWriter, from, to security.Authentication)
type MfaMWOptions ¶
type MfaMWOptions struct { Authenticator security.Authenticator SuccessHandler security.AuthenticationSuccessHandler OtpParam string }
type MfaMWOptionsFunc ¶
type MfaMWOptionsFunc func(*MfaMWOptions)
type OTPVerificationRequest ¶
type OTPVerificationRequest struct {
Error bool `form:"error"`
}
type PageOptionsFunc ¶
type PageOptionsFunc func(*DefaultFormLoginPageOptions)
type RememberUsernameSuccessHandler ¶
type RememberUsernameSuccessHandler struct {
// contains filtered or unexported fields
}
func (*RememberUsernameSuccessHandler) HandleAuthenticationSuccess ¶
func (h *RememberUsernameSuccessHandler) HandleAuthenticationSuccess(c context.Context, r *http.Request, rw http.ResponseWriter, _, to security.Authentication)
Click to show internal directories.
Click to hide internal directories.