authentication

package
v0.0.0-...-cebd13c Latest Latest
Warning

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

Go to latest
Published: May 27, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyProviderPreChecker      = "authentication.provider.prechecker.set"
	KeyProviderPostChecker     = "authentication.provider.postchecker.set"
	KeyProviderAuthorityMapper = "authentication.provider.authority.mapper.set"
)
View Source
const (
	KeyManagerAddProvider = "authentication.manager.provider.add"
)

Variables

This section is empty.

Functions

func ManagerOptAddProviders

func ManagerOptAddProviders(providers ...Provider) core.Opt

func NewManager

func NewManager(opts ...core.Opt) *defaultManager

func ProviderOptSetAuthorityMapper

func ProviderOptSetAuthorityMapper(mapper authority.Mapper) core.Opt

func ProviderOptSetPostChecker

func ProviderOptSetPostChecker(checker userdetails.Checker) core.Opt

func ProviderOptSetPreChecker

func ProviderOptSetPreChecker(checker userdetails.Checker) core.Opt

Types

type Authentication

type Authentication interface {
	GetName() string

	GetAuthorities() []authority.GrantedAuthority

	GetCredentials() interface{}

	GetDetails() interface{}

	GetPrincipal() interface{}

	IsAuthenticated() bool

	SetAuthenticated(flag bool) error
}

type BaseAuthentication

type BaseAuthentication struct {
	Authentication
	// contains filtered or unexported fields
}

func (*BaseAuthentication) GetAuthorities

func (auth *BaseAuthentication) GetAuthorities() []authority.GrantedAuthority

func (*BaseAuthentication) GetDetails

func (auth *BaseAuthentication) GetDetails() interface{}

func (*BaseAuthentication) GetName

func (auth *BaseAuthentication) GetName() string

func (*BaseAuthentication) IsAuthenticated

func (auth *BaseAuthentication) IsAuthenticated() bool

func (*BaseAuthentication) SetAuthenticated

func (auth *BaseAuthentication) SetAuthenticated(flag bool) error

func (*BaseAuthentication) SetDetails

func (auth *BaseAuthentication) SetDetails(details interface{})

type Manager

type Manager interface {
	Authenticate(auth Authentication) (Authentication, error)
}

type Provider

type Provider interface {
	Authenticate(auth Authentication) (Authentication, error)
	Support(o interface{}) bool
}

type UserDetailsAuthenticationChecker

type UserDetailsAuthenticationChecker interface {
	Retrieve(username string, authentication *UsernamePasswordAuthentication) (userdetails.UserDetails, error)
	AdditionalAuthenticationCheck(username string, authentication *UsernamePasswordAuthentication) error
}

type UserDetailsAuthenticationProvider

type UserDetailsAuthenticationProvider struct {
	UserDetailsAuthenticationChecker
	// contains filtered or unexported fields
}

func NewUserDetailsAuthenticationProvider

func NewUserDetailsAuthenticationProvider(opts ...core.Opt) *UserDetailsAuthenticationProvider

func (*UserDetailsAuthenticationProvider) Authenticate

func (*UserDetailsAuthenticationProvider) Set

func (p *UserDetailsAuthenticationProvider) Set(key string, value interface{})

func (*UserDetailsAuthenticationProvider) Support

func (p *UserDetailsAuthenticationProvider) Support(o interface{}) bool

type UsernamePasswordAuthentication

type UsernamePasswordAuthentication struct {
	BaseAuthentication
	// contains filtered or unexported fields
}

func NewUsernamePasswordAuthentication

func NewUsernamePasswordAuthentication(credentials, principal interface{}, authorities []authority.GrantedAuthority) *UsernamePasswordAuthentication

func (*UsernamePasswordAuthentication) GetCredentials

func (auth *UsernamePasswordAuthentication) GetCredentials() interface{}

func (*UsernamePasswordAuthentication) GetPrincipal

func (auth *UsernamePasswordAuthentication) GetPrincipal() interface{}

Jump to

Keyboard shortcuts

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