Documentation ¶
Index ¶
Constants ¶
View Source
const ( // IdentityDisplayNameKey is the key for an optional display name in an identity's Extra map IdentityDisplayNameKey = "name" // IdentityEmailKey is the key for an optional email address in an identity's Extra map IdentityEmailKey = "email" // IdentityPreferredUsernameKey is the key for an optional preferred username in an identity's Extra map. // This is useful when the immutable providerUserName is different than the login used to authenticate // If present, this extra value is used as the preferred username IdentityPreferredUsernameKey = "preferred_username" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultUserIdentityInfo ¶
type DefaultUserIdentityInfo struct { ProviderName string ProviderUserName string Extra map[string]string }
func NewDefaultUserIdentityInfo ¶
func NewDefaultUserIdentityInfo(providerName, providerUserName string) *DefaultUserIdentityInfo
NewDefaultUserIdentityInfo returns a DefaultUserIdentityInfo with a non-nil Extra component
func (*DefaultUserIdentityInfo) GetExtra ¶
func (i *DefaultUserIdentityInfo) GetExtra() map[string]string
func (*DefaultUserIdentityInfo) GetIdentityName ¶ added in v0.4.2
func (i *DefaultUserIdentityInfo) GetIdentityName() string
func (*DefaultUserIdentityInfo) GetProviderName ¶
func (i *DefaultUserIdentityInfo) GetProviderName() string
func (*DefaultUserIdentityInfo) GetProviderUserName ¶ added in v0.4.2
func (i *DefaultUserIdentityInfo) GetProviderUserName() string
type UserIdentityInfo ¶
type UserIdentityInfo interface { // GetIdentityName returns the name of this identity. It must be equal to GetProviderName() + ":" + GetProviderUserName() GetIdentityName() string // GetProviderName returns the name of the provider of this identity. GetProviderName() string // GetProviderUserName uniquely identifies this particular identity for this provider. It is NOT guaranteed to be unique across providers GetProviderUserName() string // GetExtra is a map to allow providers to add additional fields that they understand GetExtra() map[string]string }
UserIdentityInfo contains information about an identity. Identities are distinct from users. An authentication server of some kind (like oauth for example) describes an identity. Our system controls the users mapped to this identity.
type UserIdentityMapper ¶
type UserIdentityMapper interface { // UserFor takes an identity, ignores the passed identity.Provider, forces the provider value to some other value and then creates the mapping. // It returns the corresponding user.Info UserFor(identityInfo UserIdentityInfo) (user.Info, error) }
UserIdentityMapper maps UserIdentities into user.Info objects to allow different user abstractions within auth code.
Click to show internal directories.
Click to hide internal directories.