internal

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProofKey

func ProofKey(key *ecdsa.PrivateKey) jose.JSONWebKey

Types

type Token

type Token[C any] struct {
	// IssueInstant is the time when the Token is created.
	IssueInstant time.Time
	// NotAfter is the expiration time of the Token.
	NotAfter time.Time
	// Token is the JWT for the Token.
	Token string
	// DisplayClaims contains additional data claimed from the issuer of
	// the Token. It generally contains fields about representing a user,
	// device, or title.
	DisplayClaims C
}

Token represents the basic structure of the Token issued by various Xbox Authentication Services (XAS). The C generic type indicates the struct type of the DisplayClaims field.

func (*Token[C]) Valid

func (t *Token[C]) Valid() bool

Valid returns whether the Token is a valid token.

type TokenRequest

type TokenRequest[P any] struct {
	// RelyingParty is a URI representing the relying-party, which the token should be
	// authorized for. It is typically 'http' or 'rp' URI.
	RelyingParty string

	// TokenType indicates that type of the token.
	// It is typically 'JWT' for most tokens.
	TokenType string

	// Properties is the properties specific to the token.
	// It may contain the 'ProofKey' field, which is a JWK object
	// representing the key used for the device token.
	Properties P
}

TokenRequest represents the wire structure of the request used for requesting tokens in Xbox Authentication Services. Make sure to specify the P generic type to whatever you want to specify in the Properties field.

func (TokenRequest[P]) Do

func (r TokenRequest[P]) Do(ctx context.Context, config xal.Config, reqURL string, proofKey *ecdsa.PrivateKey, respBody any) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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