1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2024-12-04 10:30:19 -05:00
forgejo/vendor/github.com/yohcop/openid-go
Mura Li d77176912b Use Go1.11 module (#5743)
* Migrate to go modules

* make vendor

* Update mvdan.cc/xurls

* make vendor

* Update code.gitea.io/git

* make fmt-check

* Update github.com/go-sql-driver/mysql

* make vendor
2019-03-27 19:15:23 +08:00
..
.travis.yml Use Go1.11 module (#5743) 2019-03-27 19:15:23 +08:00
discover.go Login via OpenID-2.0 (#618) 2017-03-17 15:16:08 +01:00
discovery_cache.go Login via OpenID-2.0 (#618) 2017-03-17 15:16:08 +01:00
getter.go Login via OpenID-2.0 (#618) 2017-03-17 15:16:08 +01:00
html_discovery.go Migrate to dep (#3972) 2018-05-21 15:34:20 +03:00
LICENSE Login via OpenID-2.0 (#618) 2017-03-17 15:16:08 +01:00
nonce_store.go Login via OpenID-2.0 (#618) 2017-03-17 15:16:08 +01:00
normalizer.go Login via OpenID-2.0 (#618) 2017-03-17 15:16:08 +01:00
openid.go Login via OpenID-2.0 (#618) 2017-03-17 15:16:08 +01:00
README.md Use Go1.11 module (#5743) 2019-03-27 19:15:23 +08:00
redirect.go Login via OpenID-2.0 (#618) 2017-03-17 15:16:08 +01:00
verify.go Login via OpenID-2.0 (#618) 2017-03-17 15:16:08 +01:00
xrds.go Login via OpenID-2.0 (#618) 2017-03-17 15:16:08 +01:00
yadis_discovery.go Login via OpenID-2.0 (#618) 2017-03-17 15:16:08 +01:00

openid.go

This is a consumer (Relying party) implementation of OpenId 2.0, written in Go.

go get -u github.com/yohcop/openid-go

Build Status

Github

Be awesome! Feel free to clone and use according to the licence. If you make a useful change that can benefit others, send a pull request! This ensures that one version has all the good stuff and doesn't fall behind.

Code example

See _example/ for a simple webserver using the openID implementation. Also, read the comment about the NonceStore towards the top of that file. The example must be run for the openid-go directory, like so:

go run _example/server.go

App Engine

In order to use this on Google App Engine, you need to create an instance with a custom *http.Client provided by urlfetch.

oid := openid.NewOpenID(urlfetch.Client(appengine.NewContext(r)))
oid.RedirectURL(...)
oid.Verify(...)

License

Distributed under the Apache v2.0 license.