idfabric

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributeProvider

type AttributeProvider interface {
	// Query is used to retrieve attributes for a user. A user's subject and the
	// requested attributes are consumed as params.
	//
	// When a query is successful, key-value pairs of the requested attributes are
	// returned. When a given AttributeProvider returns a multivalued attribute such
	// as group memberships, the values are concatenated using a delimiter that is
	// defined on the Identity Fabric component.
	Query(subject string, attributes []string) (map[string]string, error)
}

AttributeProvider is used to retrieve attributes from an external system. A common attribute provider would be a data store such as LDAP.

type IdentityProvider

type IdentityProvider interface {
	// Login provides a front-channel user login flow. The user will be redirected
	// to the underlying IDP to authenticate the user.
	Login(rw http.ResponseWriter, req *http.Request, opts ...LoginOpt)
}

IdentityProvider enables a way to interact with the identity provider. Interactions may include login and logout.

type LoginOpt added in v0.10.0

type LoginOpt func(cfg *LoginOptions)

LoginOpt allows for customizing the login experience.

func WithLoginHint added in v0.10.0

func WithLoginHint(username string) LoginOpt

WithLoginHint specifies the username of the user to the IdentityProvider. This usually allows a known user to skip having to enter their username when prompted for authentication to the IdentityProvider.

func WithQueryParam added in v0.20.0

func WithQueryParam(k, v string) LoginOpt

WithQueryParam enables a way to specify custom query parameters to be added to the authorization request.

func WithRedirectURL added in v0.10.0

func WithRedirectURL(url string) LoginOpt

WithRedirectURL specifies landing page for the user after authenticating to the IdentityProvider.

func WithSilentAuthentication added in v0.18.0

func WithSilentAuthentication() LoginOpt

WithSilentAuthentication specifies to the IDP that no user interaction should occur as part of the login.

In the context of OIDC, this option will result in the 'prompt=none' query parameter being sent as part of the authentication request. For more details, please see the OIDC RFC https://openid.net/specs/openid-connect-core-1_0-final.html#AuthRequest.

type LoginOptions added in v0.10.0

type LoginOptions struct {
	Username             string
	RedirectURL          string
	SilentAuthentication bool
	QueryParams          url.Values
}

LoginOptions store the options used to customize the user experience when calling Login on an IdentityProvider.

Jump to

Keyboard shortcuts

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