Documentation ¶
Index ¶
Constants ¶
View Source
const CookieName = "Helios_Authorization"
CookieName is the name of the cookie that contains the JWT token
View Source
const HeaderName = "Helios-Jwt-Assertion"
HeaderName is the name of the cookie that contains the JWT token
Variables ¶
ErrUnauthorized is returned by the middleware when a request is not authorized
Functions ¶
func IssueJWTWithSecret ¶
IssueJWTWithSecret issues and sign a JWT with a secret
func ValidateJWTWithSecret ¶
ValidateJWTWithSecret checks JWT signing algorithm as well the signature
Types ¶
type Helios ¶
type Helios struct {
// contains filtered or unexported fields
}
Helios represents a middleware instance that can authenticate requests
func NewHeliosAuthentication ¶
func NewHeliosAuthentication(provider providers.OAuth2Provider, jwtSecret string, jwtExpiration time.Duration) Helios
NewHeliosAuthentication creates a new authentication middleware instance
func (Helios) CallbackHandler ¶
func (helios Helios) CallbackHandler(w http.ResponseWriter, r *http.Request)
CallbackHandler handles OAuth2 callback flow
Click to show internal directories.
Click to hide internal directories.