auth

package
v0.0.0-...-4c5779b Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2016 License: LGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareHashAndPassword

func CompareHashAndPassword(password string, hashedPassword string) error

func GenerateHashFromPassword

func GenerateHashFromPassword(password string) string

func GenerateRandomString

func GenerateRandomString(length int) (string, error)

func Initialize

func Initialize(s SessionProvider, cookieStoreAuthenticationKey string, cookieStoreEncryptionKey string, jwtSigningKeyString string, cookieIssuer string)

Types

type SessionProvider

type SessionProvider interface {
	FindBySession(session string) error
}

type TokenData

type TokenData struct {
	UserId             string
	TokenString        string
	RefreshTokenString string
	XsrfToken          string
	FromHttp           bool
	SessionIdentifier  string
}

func Authorize

func Authorize(r *http.Request, developmentMode bool) (session *sessions.Session, tokenData *TokenData, err error)

func AuthorizeJSON

func AuthorizeJSON(r *http.Request, developmentMode bool) (tokenData *TokenData, err error)

func Login

func Login(userId string, fromHttp bool, developmentMode bool) (tokenData *TokenData, err error)

func Logout

func Logout(session *sessions.Session, developmentMode bool) (originalTokenData *TokenData)

func ParseToken

func ParseToken(tokenString string, fromHttp bool, developmentMode bool) (tokenData *TokenData, err error)

func ParseTokenWithRefreshToken

func ParseTokenWithRefreshToken(tokenString string, refreshTokenString string, fromHttp bool, developmentMode bool) (newToken bool, tokenData *TokenData, err error)

Jump to

Keyboard shortcuts

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