auth

package
v0.0.0-...-edc38d9 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Overview

*

  • Copyright 2020 Whiteblock Inc. All rights reserved.
  • Use of this source code is governed by a BSD-style
  • license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingJWT = errors.New("missing JWT in authorization header")
	InvalidHeader = errors.New("invalid auth header")
	InvalidClaim  = errors.New("invalid claim")
)

Functions

func VerifyToken

func VerifyToken(verifier *oidc.IDTokenVerifier, ctx context.Context, header string) (*oidc.IDToken, error)

Types

type UserContext

type UserContext struct {
	KeycloakID string `json:"sub"`
	Username   string `json:"preferred_username"`
	Email      string `json:"email"`
}

func GetUserContext

func GetUserContext(token *oidc.IDToken) (*UserContext, error)

Jump to

Keyboard shortcuts

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