silvergorillajwt

package module
v0.0.0-...-96a5073 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

Check the example.

THIS PROJECT IS WIP. DO NOT USE IN PRODUCT JUST YET.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorsHeaders

func CorsHeaders(name string, w *http.ResponseWriter, req *http.Request) bool

Types

type CustomClaims

type CustomClaims struct {
	Scope       string              `json:"scope"`
	RealmAccess map[string][]string `json:"realm_access"`
	jwt.StandardClaims
}

type JSONWebKeys

type JSONWebKeys struct {
	Kty string   `json:"kty"`
	Kid string   `json:"kid"`
	Use string   `json:"use"`
	N   string   `json:"n"`
	E   string   `json:"e"`
	X5c []string `json:"x5c"`
}

type Jwks

type Jwks struct {
	Keys []JSONWebKeys `json:"keys"`
}

type SilverGorilla

type SilverGorilla struct {
	IssStr  string // issuer string for keycloak this would look like: http://{server}/auth/realms/{realm}
	CertURL string // certificates, for example with KeyCloak this would be /auth/realms/{realm}/protocol/openid-connect/certs
	Jwks    Jwks   // JWT Keys
}

func (SilverGorilla) GetJWKs

func (sg SilverGorilla) GetJWKs() error

GetJWKs gets the JWKs from the well known Cert address and populates the sg type.

func (SilverGorilla) SilverGorillaMiddlewareHandler

func (sg SilverGorilla) SilverGorillaMiddlewareHandler(h http.Handler) http.Handler

func (SilverGorilla) ValidationKeyGetter

func (sg SilverGorilla) ValidationKeyGetter(token *jwt.Token) (interface{}, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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