community: Index | Files | Directories

package auth

import ""


Package Files

add.go endpoint.go jwt.go secrets.go

func AddExternalUser Uses

func AddExternalUser(ctx domain.RequestContext, rt *env.Runtime, store *store.Store, u user.User, addSpace bool) (nu user.User, err error)

AddExternalUser method to setup user account in Documize using Keycloak/LDAP provided user data.

func DecodeJWT Uses

func DecodeJWT(rt *env.Runtime, tokenString string) (c domain.RequestContext, claims jwt.Claims, err error)

DecodeJWT decodes raw token.

func DecodeKeycloakJWT Uses

func DecodeKeycloakJWT(t, pk string) (c jwt.MapClaims, err error)

DecodeKeycloakJWT takes in Keycloak token string and decodes it.

func FindJWT Uses

func FindJWT(r *http.Request) (token string)

FindJWT looks for 'Authorization' request header OR query string "?token=XXX".

func GenerateJWT Uses

func GenerateJWT(rt *env.Runtime, user, org, domain string) string

GenerateJWT generates JSON Web Token (

func StripAuthSecrets Uses

func StripAuthSecrets(r *env.Runtime, provider, config string) string

StripAuthSecrets removes sensitive data from auth provider configuration

type Handler Uses

type Handler struct {
    Runtime *env.Runtime
    Store   *store.Store

Handler contains the runtime information such as logging and database.

func (*Handler) Login Uses

func (h *Handler) Login(w http.ResponseWriter, r *http.Request)

Login user based up HTTP Authorization header. An encrypted authentication token is issued with an expiry date.

func (*Handler) ValidateToken Uses

func (h *Handler) ValidateToken(w http.ResponseWriter, r *http.Request)

ValidateToken finds and validates authentication token. TODO: remove



Package auth imports 22 packages (graph) and is imported by 11 packages. Updated 2019-11-15. Refresh now. Tools for package owners.