auth

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, authenticator Authenticator)

Register add different authenticators to registry map.

Types

type AuthController

type AuthController struct {
	beego.Controller
}

AuthController operations for Auth

func (*AuthController) CurrentUser

func (c *AuthController) CurrentUser()

@router /currentuser [get]

func (*AuthController) Login

func (c *AuthController) Login()

type is login type name when login type is oauth2 used for oauth2 type @router /login/:type/?:name [get,post]

func (*AuthController) Logout

func (c *AuthController) Logout()

@router /logout [get]

func (*AuthController) URLMapping

func (c *AuthController) URLMapping()

URLMapping ...

type Authenticator

type Authenticator interface {
	// Authenticate ...
	Authenticate(m models.AuthModel) (*models.User, error)
}

Authenticator provides interface to authenticate user credentials.

type LoginData

type LoginData struct {
	UserName string `json:"username"`
	Password string `json:"password"`
}

login post data

type LoginResult

type LoginResult struct {
	Token string `json:"token"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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