Comments (4)
nonceStore := &openid.SimpleNonceStore{Store: make(map[string][]*openid.Nonce)}
discoveryCache := &openid.SimpleDiscoveryCache{}
opEndpoint, opLocalID, claimedID, err := openid.Discover(url)
query := "?openid.return_to=http://localhost:3000" +
"&openid.ns=http://specs.openid.net/auth/2.0" +
"&openid.op_endpoint=" + opEndpoint +
"&openid.identity=" + opLocalID +
"&openid.claimed_id=" + claimedID
requrl := "http://localhost:3000" + query
openID, err := openid.Verify(requrl, discoveryCache, nonceStore)
if err != nil {
fmt.Println(err) // -> Could not verify that the claimed ID
}
from openid-go.
Sorry, I'm not sure I understand the question.
The nonce store and discovery cache must be long lived objects, and must survive multiple requests (and the same instances must be used for all requests). so I'm not sure how to interpret your example: are you creating the nonceStore
and discoveryCache
just before calling Verify?
fullurl
is the URL where the user was redirected to after authentication.
Hope that helps!
from openid-go.
@keitaj you'll want to use RedirectURL, then you'd get a callback to the URL you specify, and can pass that callback full URL (which would include query params) to the Verify method.
At least, that's how it works for me here: go-gitea/gitea#618
from openid-go.
Closing this, it's old now. If you are still having issues, let us know!
from openid-go.
Related Issues (17)
- invalid url for `go get` HOT 4
- Not getting Endpoint from Steam OpenID HOT 4
- Dedicated LICENSE file (outside of README)
- Add extension support? HOT 1
- Google integration test fails
- License? HOT 3
- strings can be empty HOT 1
- Can not compile in latest go versions
- discovery-cache HOT 3
- Created a package that allows users to use GORM to store their nonce / discovery cache HOT 3
- wordpress.com OpenID provider not supported HOT 7
- How do I retrive nickname/email ? HOT 15
- Provide a time-based discovery cache ? HOT 8
- Don't endorse https://github.com/fduraffourg/go-openid
- Does not support link elements with multiple rel values HOT 2
- Nonce too old HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openid-go.