jwx

package
v11.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeAccessToken

func DecodeAccessToken(accessToken string, e, n *string) (*jwt.Token, *jwt.MapClaims, error)

DecodeAccessToken currently only supports RSA - sorry for that

func DecodeAccessTokenCustomClaims

func DecodeAccessTokenCustomClaims(accessToken string, e, n *string, customClaims jwt.Claims) (*jwt.Token, error)

DecodeAccessTokenCustomClaims currently only supports RSA - sorry for that

func SignClaims

func SignClaims(claims jwt.Claims, key interface{}, method jwt.SigningMethod) (string, error)

SignClaims signs the given claims using a given key and a method

Types

type Account

type Account struct {
	Roles []string `json:"roles,omitempty"`
}

Account holds TODO: What does it hold?

type Address

type Address struct {
}

Address TODO what fields does any address have?

type Claims

type Claims struct {
	jwt.StandardClaims
	Typ               string         `json:"typ,omitempty"`
	Azp               string         `json:"azp,omitempty"`
	AuthTime          int            `json:"auth_time,omitempty"`
	SessionState      string         `json:"session_state,omitempty"`
	Acr               string         `json:"acr,omitempty"`
	AllowedOrigins    []string       `json:"allowed-origins,omitempty"`
	RealmAccess       RealmAccess    `json:"realm_access,omitempty"`
	ResourceAccess    ResourceAccess `json:"resource_access,omitempty"`
	Scope             string         `json:"scope,omitempty"`
	EmailVerified     bool           `json:"email_verified,omitempty"`
	Address           Address        `json:"address,omitempty"`
	Name              string         `json:"name,omitempty"`
	PreferredUsername string         `json:"preferred_username,omitempty"`
	GivenName         string         `json:"given_name,omitempty"`
	FamilyName        string         `json:"family_name,omitempty"`
	Email             string         `json:"email,omitempty"`
	ClientID          string         `json:"clientId,omitempty"`
	ClientHost        string         `json:"clientHost,omitempty"`
	ClientIP          string         `json:"clientAddress,omitempty"`
}

Claims served by keycloak inside the accessToken

type DecodedAccessTokenHeader

type DecodedAccessTokenHeader struct {
	Alg string `json:"alg"`
	Typ string `json:"typ"`
	Kid string `json:"kid"`
}

DecodedAccessTokenHeader is the decoded header from the access token

func DecodeAccessTokenHeader

func DecodeAccessTokenHeader(token string) (*DecodedAccessTokenHeader, error)

DecodeAccessTokenHeader decodes the header of the accessToken

type RealmAccess

type RealmAccess struct {
	Roles []string `json:"roles,omitempty"`
}

RealmAccess holds roles of the user

type RealmManagement

type RealmManagement struct {
	Roles []string `json:"roles,omitempty"`
}

RealmManagement holds TODO: What does it hold?

type ResourceAccess

type ResourceAccess struct {
	RealmManagement RealmManagement `json:"realm-management,omitempty"`
	Account         Account         `json:"account,omitempty"`
}

ResourceAccess holds TODO: What does it hold?

Jump to

Keyboard shortcuts

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