You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.9 KiB

  1. # openid.go
  2. This is a consumer (Relying party) implementation of OpenId 2.0,
  3. written in Go.
  4. go get -u github.com/yohcop/openid-go
  5. [![Build Status](https://travis-ci.org/yohcop/openid-go.svg?branch=master)](https://travis-ci.org/yohcop/openid-go)
  6. ## Github
  7. Be awesome! Feel free to clone and use according to the licence.
  8. If you make a useful change that can benefit others, send a
  9. pull request! This ensures that one version has all the good stuff
  10. and doesn't fall behind.
  11. ## Code example
  12. See `_example/` for a simple webserver using the openID
  13. implementation. Also, read the comment about the NonceStore towards
  14. the top of that file. The example must be run for the openid-go
  15. directory, like so:
  16. go run _example/server.go
  17. ## App Engine
  18. In order to use this on Google App Engine, you need to create an instance with a custom `*http.Client` provided by [urlfetch](https://cloud.google.com/appengine/docs/go/urlfetch/).
  19. ```go
  20. oid := openid.NewOpenID(urlfetch.Client(appengine.NewContext(r)))
  21. oid.RedirectURL(...)
  22. oid.Verify(...)
  23. ```
  24. ## License
  25. Distributed under the [Apache v2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html).
  26. ## Libraries
  27. Here is a set of libraries I found on GitHub that could make using this library easier depending on your backends. I haven't tested them, this list is for reference only, and in no particular order:
  28. - [Gacnt/myopenid](https://github.com/Gacnt/myopenid) "A Yohcop-Openid Nonce/Discovery storage replacement", using MySQL.
  29. - [Gacnt/sqlxid](https://github.com/Gacnt/sqlxid) "An SQLX Adapter for Nonce / Discovery Cache store"
  30. - [Gacnt/gormid](https://github.com/Gacnt/gormid) "Use GORM (Go Object Relational Mapping) to store OpenID DiscoveryCache / Nonce in a database"
  31. - [hectorj/mysqlOpenID](https://github.com/hectorj/mysqlOpenID) "MySQL OpenID is a package to replace the in memory storage of discoveryCache and nonceStore."