formlogin

package
v0.14.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

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 (*DefaultFormLoginController) Mappings

func (c *DefaultFormLoginController) Mappings() []web.Mapping

func (*DefaultFormLoginController) OtpVerificationForm

type DefaultFormLoginPageOptions

type DefaultFormLoginPageOptions struct {
	BuildInfoResolver bootstrap.BuildInfoResolver
	LoginTemplate     string
	UsernameParam     string
	PasswordParam     string
	LoginProcessUrl   string

	MfaTemplate   string
	OtpParam      string
	MfaVerifyUrl  string
	MfaRefreshUrl string
}

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

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 (*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

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL