Documentation ¶
Index ¶
- func BuildRedirectURL(opEndpoint, opLocalID, claimedID, returnTo, realm string) (string, error)
- 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 string, err error)
- type DiscoveredInfo
- type DiscoveryCache
- type Nonce
- type NonceStore
- type OpenID
- type SimpleDiscoveredInfo
- type SimpleDiscoveryCache
- type SimpleNonceStore
- type Xrd
- type XrdsDocument
- type XrdsIdentifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildRedirectURL ¶
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 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 OpenID ¶
type OpenID struct {
// contains filtered or unexported fields
}
func (*OpenID) RedirectURL ¶
func (*OpenID) Verify ¶
func (oid *OpenID) Verify(uri string, cache DiscoveryCache, nonceStore NonceStore) (id string, err error)
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 struct {
// contains filtered or unexported fields
}
func NewSimpleDiscoveryCache ¶
func NewSimpleDiscoveryCache() *SimpleDiscoveryCache
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 {
// contains filtered or unexported fields
}
func NewSimpleNonceStore ¶
func NewSimpleNonceStore() *SimpleNonceStore
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.