Comments (10)
Have you already enabled sticky sessions in your cluster?
Because that's probably the minimum to get this working; see also
http://stackoverflow.com/questions/27481067/why-do-i-need-sticky-sessions-with-a-spring-oauth2-jbdctokenstore
as reference.
But I'm not sure whether/how this will work for verifying the token by the
resource server: is there any guarantee that the resource server will end
up on the same application server node as the client? (open question :-) )
On 30 August 2016 at 09:35, loukikpurohit [email protected] wrote:
I deployed this application on two servers(tomcats). I changed
apis.application.properties to point to mysql.
I created token on one server but when I tried to verify it on different
server I got "token not found".
Both the servers point to same database and when token was created on one
server it was saved in database but still the other server was not able to
find it.
when I restarted this second server, the token was fetched successfully.accessTokenRepository.findByToken(accessToken); returned null even if the
token was in db.—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#94, or mute the thread
https://github.com/notifications/unsubscribe-auth/ABG69sWaSmHPBrhvSC7Ke-m50oRFbDBxks5qk91UgaJpZM4JwOt7
.
from apis.
Hi, Thanks for the reply,
I have not enabled sticky sessions but if the access token is being saved in database and both the servers point to same database then shouldn't the access token be returned from database ?
I feel that accessTokenRepository.findByToken(accessToken) is not hitting database(it returns null) and trying to fetch from cache. Is there any setting for this?
from apis.
It's probably Hibernate's first level cache (the hibernate session) that is causing this behaviour. And no, as far as I know, you cannot disable this.
from apis.
yes, but if the object is not found in cache it should hit the database and get it right? but this is not happening. Am I missing any setting? can you please let me know, I am using grant_type=client_credentials
(Note that when I use jdbc calls there it works, only question is why its not working with jpa)
from apis.
I've experienced the same behaviour @loukikpurohit , this was solved after switching tomcat-jdbc datasource implementation with BoneCP version. Running on 2 tomcats in load-balanced environment for over a year without issues.
from apis.
Thanks Tom, merged your PM. @loukikpurohit can you retest current master in your environment?
from apis.
Thanks Tom, it worked for me too. :)
from apis.
I also have the same issue. I use tomcat configuration in context.xml as below rather than in code. Could you guys guide me to change?
from apis.
from apis.
from apis.
Related Issues (20)
- how to get authenticated user info after access token? HOT 1
- on android jax should only be used as a last resort because it will mess with the JavaScript that was originally in place once rebuilt, HOT 4
- GZip supporting
- Restart / Restore of API Server Authentication Credentials HOT 1
- Minimum Java version HOT 1
- PostgreSQL HOT 1
- Not working in distributed environment(when deployed on 2 tomcats) HOT 1
- As cnntributor I'd like to submit a pull request HOT 1
- Deployment and Config documentation
- ar
- Your project OAuth-Apis apis is using buggy third-party libraries [WARNING]
- Authorization as a service suggested alternative
- failed build from fresh checkout HOT 3
- User consent request for Implicit flow HOT 2
- draft-ietf-oauth-v2-31 vs rfc6749 HOT 1
- OAuth 2.0 Token Introspection - RFC 7662 HOT 4
- Failed to execute goal org.apache.openjpa:openjpa-maven-plugin:2.2.0 HOT 1
- Multiple OAuth apis instances with shared MYSQL DB - Clustering HOT 2
- https for AuthorizationServer at localhost
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 apis.