jwt

package
v0.0.0-...-f7d5a40 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ISSUER = "https://iam.ng.bluemix.net/oidc/token"
	ALG    = "RS256"
)

Variables

View Source
var (
	MALFORMED         = errors.New("Malformed JWT token")
	DECODE_FAILURE    = errors.New("Decode JWT token failure")
	UNMARSHAL_FAILURE = errors.New("Unmarshal JWT token failure")
	UNEXPECTED_ISSUER = errors.New("The issuer in JWT is not supported")
	EXPIRED_TOKEN     = errors.New("Expired token")
	ISSUE_AT_ERROR    = errors.New("Token used before issued")
	UNSUPPORTED_ALG   = errors.New("Unsupported algorithm")
)

Functions

func NewJwtAuth

func NewJwtAuth(manager jwk.IbmJwksManager) interfaces.Auth

Types

type IbmHeader

type IbmHeader struct {
	Kid string `json:"kid"` // key type
	Alg string `json:"alg"` // algorithm for the key
}

type IbmJwt

type IbmJwt struct {
	IbmHeader
	IbmPayload
	RawString string
}

type IbmPayload

type IbmPayload struct {
	IamId      string   `json:"iam_id"`
	Id         string   `json:"id"`
	Realmid    string   `json:"realmid"`
	Identifier string   `json:"identifier"`
	GivenName  string   `json:"given_name"`
	FamilyName string   `json:"family_name"`
	Name       string   `json:"name"`
	Email      string   `json:"email"`
	Sub        string   `json:"sub"`
	Account    account  `json:"account"`
	Iat        int64    `json:"iat"`
	Exp        int64    `json:"exp"`
	Iss        string   `json:"iss"`
	GrantType  string   `json:"grant_type"`
	Scope      string   `json:"scope"`
	ClientId   string   `json:"client_id"`
	Acr        int64    `json"acr"`
	Amr        []string `json:"amr"`
}

type JwtAuth

type JwtAuth struct {
	// contains filtered or unexported fields
}

JWTAuth implements auth.Auth interface

func (*JwtAuth) Handler

func (j *JwtAuth) Handler() func(c *gin.Context)

func (*JwtAuth) Stop

func (j *JwtAuth) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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