-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sometimes occures 'invalid_grant' error #68
Comments
My mongodb is replicast structure |
Hello! Thank you for your wonderful debugging! That's fantastic! Yes, we've seen this error crop up as well and I was wondering if it was down to replication lag since the redirects are very quick, just never had the capacity to investigate. The main reason we go with secondary preferred is to try to distribute as many reads away from the primary. As soon as a write is needed to be performed the mongo driver should perform the write and any subsequent queries on the primary. If you remove the read preference and remove the write concern does it also solve the issue? (Read preference: primary) Personally, I've been pretty unwell this week, so I won't be able to jump on a machine for a week, but can respond as needed to questions via my phone/GH app |
I tested 3 case, I try 20 times below url using 'postam runner', and count error case. -> This url execute /authorize and /token in a row from example source a) ReadPrefrenece - secondary ( default) b) ReadPrefrenece - primary c) ReadPrefrenece - secondary and WriteConcern(Wmajority()) teso case b) and case c) , no error. |
I need to solve this problem, |
Changed: - deps: updates to `github.com/google/uuid@v1.3.0`. - deps: updates to `github.com/sirupsen/logrus@v1.8.1`. - deps: updates to `github.com/stretchr/testify@v1.7.0`. - deps: updates to `go.mongodb.org/mongo-driver@v1.11.1`. - deps: updates `examples/mongo` to `github.com/sirupsen/logrus@v1.8.1`. - deps: updates `examples/mongo` to `golang.org/x/net@v0.0.0-20220926192436-02166a98028e`. - deps: updates `examples/mongo` to `golang.org/x/oauth2@v0.0.0-20220909003341-f21342109be1`. - deps: updates `examples/mongo` to `go.mongodb.org/mongo-driver@v1.11.1`. - examples/mongo/authorizationserver: migrates deprecated use of `Exact()` to `ExactOne()`. - storage: gofmts the project with go@1.19. Fixed: - examples/mongo/authorizationserver: sets session subject and username. fixes #65. - examples/mongo/authorizationserver: properly logs out the generated user id. - mongo/mongo: reduces read errors occurring in a mongo replica set. fixes #68.
🚢 v0.31.0 - 2023-01-10 Changed: - deps: updates to `github.com/google/uuid@v1.3.0`. - deps: updates to `github.com/sirupsen/logrus@v1.8.1`. - deps: updates to `github.com/stretchr/testify@v1.7.0`. - deps: updates to `go.mongodb.org/mongo-driver@v1.11.1`. - deps: updates `examples/mongo` to `github.com/sirupsen/logrus@v1.8.1`. - deps: updates `examples/mongo` to `golang.org/x/net@v0.0.0-20220926192436-02166a98028e`. - deps: updates `examples/mongo` to `golang.org/x/oauth2@v0.0.0-20220909003341-f21342109be1`. - deps: updates `examples/mongo` to `go.mongodb.org/mongo-driver@v1.11.1`. - examples/mongo/authorizationserver: migrates deprecated use of `Exact()` to `ExactOne()`. - storage: gofmts the project with go@1.19. Fixed: - examples/mongo/authorizationserver: sets session subject and username. fixes #65 - examples/mongo/authorizationserver: properly logs out the generated user id. - mongo/mongo: reduces read errors occurring in a mongo replica set. fixes #68.
Changed: - deps: updates to `github.com/google/uuid@v1.3.0`. - deps: updates to `github.com/sirupsen/logrus@v1.8.1`. - deps: updates to `github.com/stretchr/testify@v1.7.0`. - deps: updates to `go.mongodb.org/mongo-driver@v1.11.1`. - deps: updates `examples/mongo` to `github.com/sirupsen/logrus@v1.8.1`. - deps: updates `examples/mongo` to `golang.org/x/net@v0.0.0-20220926192436-02166a98028e`. - deps: updates `examples/mongo` to `golang.org/x/oauth2@v0.0.0-20220909003341-f21342109be1`. - deps: updates `examples/mongo` to `go.mongodb.org/mongo-driver@v1.11.1`. - examples/mongo/authorizationserver: migrates deprecated use of `Exact()` to `ExactOne()`. - storage: gofmts the project with go@1.19. Fixed: - examples/mongo/authorizationserver: sets session subject and username. fixes #65. - examples/mongo/authorizationserver: properly logs out the generated user id. - mongo/mongo: reduces read errors occurring in a mongo replica set. fixes #68.
🚢 v0.31.0 - 2023-01-10 Changed: - deps: updates to `github.com/google/uuid@v1.3.0`. - deps: updates to `github.com/sirupsen/logrus@v1.8.1`. - deps: updates to `github.com/stretchr/testify@v1.7.0`. - deps: updates to `go.mongodb.org/mongo-driver@v1.11.1`. - deps: updates `examples/mongo` to `github.com/sirupsen/logrus@v1.8.1`. - deps: updates `examples/mongo` to `golang.org/x/net@v0.0.0-20220926192436-02166a98028e`. - deps: updates `examples/mongo` to `golang.org/x/oauth2@v0.0.0-20220909003341-f21342109be1`. - deps: updates `examples/mongo` to `go.mongodb.org/mongo-driver@v1.11.1`. - examples/mongo/authorizationserver: migrates deprecated use of `Exact()` to `ExactOne()`. - storage: gofmts the project with go@1.19. Fixed: - examples/mongo/authorizationserver: sets session subject and username. fixes #65. - examples/mongo/authorizationserver: properly logs out the generated user id. - mongo/mongo: reduces read errors occurring in a mongo replica set. fixes #68.
Sorry about the delay on this, version v0.31.0 has been released with the fix! Thank you! 👍 |
Hi, I 'am 'qkrgksqkr'
I implementing OIDC protocol by using this package.
It's very nice and good,
but, somtimes I have a error message 'invalid_grant' error message, while processing 'authrozation_code" flow,
Not always, just sometimes,
Detail step is like below.
step 1. Client did /authoize,, and redirect with 'authroizatio_code'
step 2 Client request /token with 'authorization_code'
If success, Client get access/ refresh / id token,
but sometimes Client get 'invalid_grant'
so, I retry step 2, with same 'authorization_code' then, it is always success
I can't understand why this is success.
In real system, the moment between step1 and step2 is very short. no extra time.
So I test with your sampe code. and added log message
I'll try postman runner..
Your sample code with mongo deafult option, localhost:27017 , stand alone
There are no error,
but mongo db is replaset (primary - second -second), similiar to my system
It occures error sometimes
So, the difference is mongo DB environment, standAlone and ReplicaSet.
Is is some additional config element that I need to set to use this package?..
I want to solve this problem.
thank you.
The text was updated successfully, but these errors were encountered: