authentication

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CookieOauth = "state"

CookieOauth is the cookie name used for login

View Source
const Disabled = 3

Disabled authentication ignores all internal authentication procedures. A reverse proxy needs to restrict access

View Source
const Header = 2

Header authentication relies on a header from a reverse proxy to parse the user name

View Source
const Internal = 0

Internal authentication method uses a user / password combination handled by Gokapi

View Source
const OAuth2 = 1

OAuth2 authentication retrieves the users email with Open Connect ID

Variables

This section is empty.

Functions

func CheckOauthUser

func CheckOauthUser(userInfo *oidc.UserInfo, w http.ResponseWriter)

CheckOauthUser checks if the user is allowed to use the Gokapi instance

func Init

func Init(config models.AuthenticationConfig)

Init needs to be called first to process the authentication configuration

func IsAuthenticated

func IsAuthenticated(w http.ResponseWriter, r *http.Request) bool

IsAuthenticated returns true if the user provides a valid authentication

func IsCorrectUsernameAndPassword

func IsCorrectUsernameAndPassword(username, password string) bool

IsCorrectUsernameAndPassword checks if a provided username and password is correct

func IsEqualStringConstantTime

func IsEqualStringConstantTime(s1, s2 string) bool

IsEqualStringConstantTime uses ConstantTimeCompare to prevent timing attack.

func IsLogoutAvailable

func IsLogoutAvailable() bool

IsLogoutAvailable returns true if a logout button should be shown with the current form of authentication

func Logout

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

Logout logs the user out and removes the session

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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