Documentation ¶
Index ¶
- Constants
- func CheckOauthUser(userInfo *oidc.UserInfo, w http.ResponseWriter)
- func Init(config models.AuthenticationConfig)
- func IsAuthenticated(w http.ResponseWriter, r *http.Request) bool
- func IsCorrectUsernameAndPassword(username, password string) bool
- func IsEqualStringConstantTime(s1, s2 string) bool
- func IsLogoutAvailable() bool
- func Logout(w http.ResponseWriter, r *http.Request)
Constants ¶
const CookieOauth = "state"
CookieOauth is the cookie name used for login
const Disabled = 3
Disabled authentication ignores all internal authentication procedures. A reverse proxy needs to restrict access
const Header = 2
Header authentication relies on a header from a reverse proxy to parse the user name
const Internal = 0
Internal authentication method uses a user / password combination handled by Gokapi
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 ¶
IsCorrectUsernameAndPassword checks if a provided username and password is correct
func IsEqualStringConstantTime ¶
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
Types ¶
This section is empty.