Documentation ¶
Index ¶
- func Discover(id string) (opEndpoint, opLocalId, claimedId string, err error)
- func Normalize(id string) (string, error)
- func RedirectUrl(id, callbackUrl, realm string) (string, error)
- func Verify(uri string, cache DiscoveryCache, nonceStore NonceStore) (id map[string]string, err error)
- type DiscoveredInfo
- type DiscoveryCache
- type Nonce
- type NonceStore
- type SimpleDiscoveredInfo
- type SimpleDiscoveryCache
- type SimpleNonceStore
- type Xrd
- type XrdsDocument
- type XrdsIdentifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Discover ¶
7.3.1. Discovered Information Upon successful completion of discovery, the Relying Party will have one or more sets of the following information (see the Terminology section for definitions). If more than one set of the following information has been discovered, the precedence rules defined in [XRI_Resolution_2.0] are to be applied.
- OP Endpoint URL
- Protocol Version
If the end user did not enter an OP Identifier, the following information will also be present:
- Claimed Identifier
- OP-Local Identifier
If the end user entered an OP Identifier, there is no Claimed Identifier. For the purposes of making OpenID Authentication requests, the value "http://specs.openid.net/auth/2.0/identifier_select" MUST be used as both the Claimed Identifier and the OP-Local Identifier when an OP Identifier is entered.
func RedirectUrl ¶
func Verify ¶
func Verify(uri string, cache DiscoveryCache, nonceStore NonceStore) (id map[string]string, err error)
Types ¶
type DiscoveredInfo ¶
type DiscoveryCache ¶
type DiscoveryCache interface { Put(id string, info DiscoveredInfo) // Return a discovered info, or nil. Get(id string) DiscoveredInfo }
type NonceStore ¶
type SimpleDiscoveredInfo ¶
type SimpleDiscoveredInfo struct {
// contains filtered or unexported fields
}
func (*SimpleDiscoveredInfo) ClaimedId ¶
func (s *SimpleDiscoveredInfo) ClaimedId() string
func (*SimpleDiscoveredInfo) OpEndpoint ¶
func (s *SimpleDiscoveredInfo) OpEndpoint() string
func (*SimpleDiscoveredInfo) OpLocalId ¶
func (s *SimpleDiscoveredInfo) OpLocalId() string
type SimpleDiscoveryCache ¶
type SimpleDiscoveryCache map[string]DiscoveredInfo
func (SimpleDiscoveryCache) Get ¶
func (s SimpleDiscoveryCache) Get(id string) DiscoveredInfo
func (SimpleDiscoveryCache) Put ¶
func (s SimpleDiscoveryCache) Put(id string, info DiscoveredInfo)
type SimpleNonceStore ¶
type SimpleNonceStore struct { Store map[string][]*Nonce // contains filtered or unexported fields }
func (*SimpleNonceStore) Accept ¶
func (d *SimpleNonceStore) Accept(endpoint, nonce string) error
type Xrd ¶
type Xrd struct {
Service []*XrdsIdentifier `xml:"Service"`
}
type XrdsDocument ¶
type XrdsIdentifier ¶
type XrdsIdentifier struct { Type []string `xml:"Type"` Uri string `xml:"URI"` LocalId string `xml:"LocalID"` Priority int `xml:"priority,attr"` }
TODO: As per 11.2 in openid 2 specs, a service may have multiple
URIs. We don't care for discovery really, but we do care for verification though.