oidc

package
v0.1.33 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2022 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NuntioOAuth2 = "https://oauth2.nuntio.io/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Google

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

func (*Google) RedirectUrl

func (g *Google) RedirectUrl(redirectUrl, heraRedirect, namespace string, provider *models.OidcProvider) (string, error)

func (*Google) Validate

func (g *Google) Validate(ctx context.Context, oidcProvider *models.OidcProvider, code, redirectUrl string) (*models.User, error)

type GoogleUserClaim

type GoogleUserClaim struct {
	Id        string `json:"sub"`
	Email     string `json:"email"`
	Name      string `json:"name"`
	Image     string `json:"picture"`
	FirstName string `json:"given_name"`
	LastName  string `json:"family_name"`
	Verified  bool   `json:"email_verified"`
}

type Nuntio

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

func (*Nuntio) RedirectUrl

func (n *Nuntio) RedirectUrl(redirectUrl, heraRedirect, namespace string, provider *models.OidcProvider) (string, error)

func (*Nuntio) Validate

func (n *Nuntio) Validate(ctx context.Context, oidcProvider *models.OidcProvider, code, redirectUrl string) (*models.User, error)

type NuntioUserClaim

type NuntioUserClaim struct {
	Id        string    `json:"id"`
	Email     string    `json:"email"`
	FirstName string    `json:"first_name"`
	LastName  string    `json:"last_name"`
	Gender    int32     `json:"gender"`
	Birthday  time.Time `json:"birthday"`
	Address   string    `json:"address"`
	City      string    `json:"city"`
	ZipCode   string    `json:"zip_code"`
	Country   string    `json:"country"`
	SsnHash   string    `json:"ssn"`
}

type Provider

type Provider interface {
	Validate(ctx context.Context, provider *models.OidcProvider, code, redirectUrl string) (*models.User, error)
	RedirectUrl(redirectUrl, heraRedirect, namespace string, provider *models.OidcProvider) (string, error)
}

type Providers

type Providers interface {
	Get(provider models.OidcProviderType) (Provider, error)
}

func New

func New(ctx context.Context, logger *zap.Logger) (Providers, error)

type State added in v0.1.27

type State struct {
	Rand         string
	Namespace    string
	HeraRedirect string
	OidcType     models.OidcProviderType
}

Jump to

Keyboard shortcuts

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