authoidc

package
v0.0.0-...-b0d25e1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Type         = "authoidc"
	DefaultName  = "authoidc"
	DefaultRealm = "default realm"
)

Variables

View Source
var Log *logrus.Entry = logging.GetLogger("authoidc").WithField("pkg", "auth/backend/authoidc")

Functions

This section is empty.

Types

type AuthOIDC

type AuthOIDC struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func New

func New(config *Config) (*AuthOIDC, error)

func (*AuthOIDC) Authenticate

func (ao *AuthOIDC) Authenticate(pctx *auth.AuthContext, creds *auth.Credentials) (*auth.AuthContext, bool)

func (*AuthOIDC) CredentialType

func (ao *AuthOIDC) CredentialType() string

func (*AuthOIDC) FederationCallback

func (ao *AuthOIDC) FederationCallback(data interface{}) error

func (*AuthOIDC) Name

func (ao *AuthOIDC) Name() string

func (*AuthOIDC) Realm

func (ao *AuthOIDC) Realm() string

func (*AuthOIDC) Type

func (ao *AuthOIDC) Type() string

type Config

type Config struct {
	Name  string
	Realm string

	Timeout                int      `yaml:"timeout"`
	ClientId               string   `yaml:"clientID"`
	ClientSecret           string   `yaml:"clientSecret"`
	Scopes                 []string `yaml:"scopes"`
	AuthFlowTimeout        int      `yaml:"authFlowTimeout"`
	MaxPendingAuthAttempts int      `yaml:"maxPendingAuthAttempts"`
	RedirectURL            string   `yaml:"redirectURL"`
	ProviderURL            string   `yaml:"providerURL"`

	ValueMappings TokenValueMapping `yaml:"valueMappings"`

	Principals      []string
	CriticalOptions map[string]string `yaml:"criticalOptions"`
	Extensions      map[string]string
}
var Defaults *Config = &Config{
	Name:                   DefaultName,
	Realm:                  DefaultRealm,
	Scopes:                 []string{"openid", "email", "profile"},
	AuthFlowTimeout:        240,
	MaxPendingAuthAttempts: 1000,

	ValueMappings: TokenValueMapping{
		SubjectNameField:    "name",
		SubjectNameTemplate: "{{.}}",
		PrincipalsField:     "email",
		PrincipalTemplate:   "{{.}}",
	},

	Timeout: 15,
}

type TokenValueMapping

type TokenValueMapping struct {
	SubjectNameField    string `yaml:"subjectNameField"`
	SubjectNameTemplate string `yaml:"subjectNameTemplate"`
	PrincipalsField     string `yaml:"principalsField"`
	PrincipalTemplate   string `yaml:"principalTemplate"`
}

Jump to

Keyboard shortcuts

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