Permalink
Browse files

Small usage explanation

  • Loading branch information...
1 parent 3545068 commit 48d97e567480898347328cc69607ba5b23d92ddf @fduraffourg fduraffourg committed Aug 19, 2010
Showing with 29 additions and 0 deletions.
  1. +29 −0 README.markdown
View
@@ -0,0 +1,29 @@
+Go-OpenID
+=========
+
+About
+-----
+
+Go-OpenID is an attempt to implement OpenID in Golang.
+
+Usage
+-----
+
+ var o = new(openid.OpenID)
+ o.Identifier = "https://www.google.com/accounts/o8/id"
+ o.Realm = "http://example.com"
+ o.ReturnTo = "/loginCheck"
+ url := o.GetUrl()
+
+Now you have to redirect the user to the url returned. The OP will then forward the user back to you. To check the identity, do that:
+
+ var o = new(openid.OpenID)
+ o.ParseRPUrl(URL)
+ grant, err := o.Verify()
+
+grant is true if the user is authenticated, false otherwise. URL must contain the encoded content provided by the OP.
+
+Once o.ParseRPUrl(URL) is executed, all the information provided by the OP are in the map o.Params. For instance you get the identity with:
+
+ o.Params["openid.claimed_id"]
+

0 comments on commit 48d97e5

Please sign in to comment.