openid

package
v0.0.0-...-35f0f21 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2014 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Discover

func Discover(id string) (opEndpoint, opLocalId, claimedId string, err error)

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 Normalize

func Normalize(id string) (string, error)

func RedirectUrl

func RedirectUrl(id, callbackUrl, realm string) (string, error)

func Verify

func Verify(uri string, cache DiscoveryCache, nonceStore NonceStore) (id map[string]string, err error)

Types

type DiscoveredInfo

type DiscoveredInfo interface {
	OpEndpoint() string
	OpLocalId() string
	ClaimedId() string
}

type DiscoveryCache

type DiscoveryCache interface {
	Put(id string, info DiscoveredInfo)
	// Return a discovered info, or nil.
	Get(id string) DiscoveredInfo
}

type Nonce

type Nonce struct {
	T time.Time
	S string
}

type NonceStore

type NonceStore interface {
	// Returns nil if accepted, an error otherwise.
	Accept(endpoint, nonce string) 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 map[string]DiscoveredInfo

func (SimpleDiscoveryCache) Get

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 XrdsDocument struct {
	XMLName xml.Name `xml:"XRDS"`
	Xrd     *Xrd     `xml:"XRD"`
}

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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