Documentation
¶
Overview ¶
Package openid implements parts of the OpenID 2.0 standard. For more information, see: http://openid.net/specs/openid-authentication-2_0.html
Usage:
query, err := openid.Discover("http://johnsmith.myopenid.com") if err != nil { panic(err) } url := query.CreateAuthenticationRequest("http://www.sesame.com", "/loginVerifier")
Now you have to redirect the user to the url returned. The OP (OpenID Provider) will then forward the user back to you (i.e. in example to: "http://www.sesame.com/loginVerifier"), after authenticating him.
To check the user's identity afterwards, run:
grant, id, err := openid.Verify(URL)
URL is the url the user was redirected to, with the full query string. The grant variable will be true if the user was correctly authenticated, false otherwise. If the user was authenticated, id contains his identifier.
Index ¶
- func GetRedirectURL(identifier string, realm string, returnto string) (string, error)
- func Verify(url_ string) (granted bool, identifier string, err error)
- func VerifyValues(values url.Values) (granted bool, identifier string, err error)
- func YadisRequest(url_ string) (*http.Response, error)
- type Query
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRedirectURL ¶
func Verify ¶
Verify that the url given match a successfull authentication.
Return:
- true if authenticated, false otherwise
- the claimed identifier if authenticated
- eventually an error
func VerifyValues ¶
Like Verify on a parsed URL