GithubHelp home page GithubHelp logo

Comments (10)

gvanderploeg avatar gvanderploeg commented on May 28, 2024

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
.

http://www.finalist.nl

from apis.

loukikpurohit avatar loukikpurohit commented on May 28, 2024

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.

gvanderploeg avatar gvanderploeg commented on May 28, 2024

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.

loukikpurohit avatar loukikpurohit commented on May 28, 2024

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.

tomkuipers avatar tomkuipers commented on May 28, 2024

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.

gvanderploeg avatar gvanderploeg commented on May 28, 2024

Thanks Tom, merged your PM. @loukikpurohit can you retest current master in your environment?

from apis.

loukikpurohit avatar loukikpurohit commented on May 28, 2024

Thanks Tom, it worked for me too. :)

from apis.

gituser786 avatar gituser786 commented on May 28, 2024

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.

gituser786 avatar gituser786 commented on May 28, 2024

from apis.

gituser786 avatar gituser786 commented on May 28, 2024

tomcat_conf.txt

from apis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.