insysauth

package module
v0.1.37 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2021 License: MIT Imports: 12 Imported by: 0

README


INSYS Auth

INSYS Authentication Module for GO

Authentication and backend authorization mechanism for INSYS cloud-based web applications that run on GCP's Cloud Run.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticateRequest

func AuthenticateRequest(s *Service, r *http.Request) error

func VerifyFirebaseToken added in v0.0.13

func VerifyFirebaseToken(ctx context.Context, idtoken string) (*auth.Token, error)

func VerifyToken

func VerifyToken(ctx context.Context, token string, aud string) (*idtoken.Payload, error)

Types

type App added in v0.1.1

type App struct {
	Store          sessions.Store
	Name           string
	MaxSessions    int // max number of sessions per user
	SessionTimeout int // in minutes
	// contains filtered or unexported fields
}

func NewApp added in v0.1.0

func NewApp(projectID string, name string, key string) (*App, error)

newApp creates a new app session.

func (*App) IsSessionExpired added in v0.1.3

func (a *App) IsSessionExpired(w http.ResponseWriter, r *http.Request) bool

func (*App) Login added in v0.1.2

func (a *App) Login(w http.ResponseWriter, r *http.Request, uid string) error

Function for logging a user in and creating an active session.

func (*App) Logout added in v0.1.2

func (a *App) Logout(w http.ResponseWriter, r *http.Request) error

Function for logging out a user and removing session cookies.

type Service

type Service struct {
	UrlPath string
}

Struct for declaring services for authentication

Jump to

Keyboard shortcuts

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