Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var JWTConfig middleware.JWTConfig
var JWTTTL int
Functions ¶
func AuthenticateCASUser ¶
AuthenticateUser uses CAS/JWT authentication to authenticate a user, flow is:
1. Check for valid, unexpired JWT. 2. Check to see if request is authenticated with CAS 3. If no - redirect to CAS login 4. If valid CAS authentication, issue a JWT token, storing it in a cookie.
To access the information stored in the JWT use something like: claims, ok := context.Request().Context().Value("client").(*jwt.Token).Claims.(jwt.MapClaims)
Where `claims` will reutrn a key value string of claims validated by the JWT.
Included in the context will also be the set groups the user is a part of under the key "user-groups" groups, ok := context.Request().Context().Value("user-groups").(map[string]bool)
the user will also be available in the context groups, ok := context.Request().Context().Value("user").(string)
Types ¶
This section is empty.