handler

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2025 License: Apache-2.0 Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(
	config Config,
	rsaStore jwtrsa.Provider,
	secretkvStore secretkv.Provider,
) *oidcLogin

New manage secrets for signer, including caching, polling, etc..

func NewGoogleAuth

func NewGoogleAuth(clientID string) *googleVerifier

func NewMicrosoftAuth

func NewMicrosoftAuth(clientID string) *microsoftVerifier

func NewRemoteLoginVerifier

func NewRemoteLoginVerifier(rsaStore jwtrsa.Provider, keysURL string) *remoteVerifier

Types

type Config

type Config struct {
	// Issuer for the issuer field display
	Issuer string

	// PublishSecret contains the location of Secret for signing and it's multiple version
	SigningConfig SigningConfig

	// ProfileService connect to user's for public profile
	// instead of client hit the public profile API directly
	// since it can use internal network, it should be faster compared to client hit directly
	ProfileService string

	TokenExpiryMinutes int
}

type MicrosoftClaims

type MicrosoftClaims struct {
	AIO       string `json:"aio,omitempty"`
	Email     string `json:"email,omitempty"`
	LoginHint string `json:"login_hint,omitempty"`
	Nonce     string `json:"nonce,omitempty"`
	OID       string `json:"oid,omitempty"`
	Username  string `json:"preferred_username,omitempty"`
	SID       string `json:"sid,omitempty"`
	TenantID  string `json:"tid,omitempty"`
	Version   string `json:"ver,omitempty"`
	XMS       string `json:"xms_pl,omitempty"`
	jwt.StandardClaims
}

type SigningConfig

type SigningConfig struct {
	// Secret contains the address for our signing key from secret provider
	Secret string

	// Key ID
	ID string

	// PollTime to sync the signing keys
	PollTime time.Duration
}

type SigningResponse

type SigningResponse struct {
	// ID Token is JWT Token for OpenID Connect data
	IDToken string `json:"id_token,omitempty"`

	// AccessToken is a JWT token to proof that the client is authenticated by this service
	// It is separate from ID token to avo
	AccessToken string `json:"access_token,omitempty"`

	// Profile of the user.
	Profile any `json:"profile,omitempty"`
}

Jump to

Keyboard shortcuts

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