Coder Social home page Coder Social logo

Comments (10)

kyleu avatar kyleu commented on June 8, 2024

Whoops, right you are. I pulled this out of another project of mine, so it didn't get tested very well as a standalone app. I'll fix it up tonight!

from play-silhouette-postgres-async-seed.

kyleu avatar kyleu commented on June 8, 2024

Actually, it looks like everything's working correctly. As long as cookies are enabled, you'll be tracked as a guest user until you register or sign in to a different account. Is this not what you're seeing?

from play-silhouette-postgres-async-seed.

ajaygeorge91 avatar ajaygeorge91 commented on June 8, 2024

No. For me its not tracking the session. for every request separate userdata, anonymous session are getting created. I cannot track whats happening after eventbus.publish(...)
Cookies and all are enabled.

from play-silhouette-postgres-async-seed.

kyleu avatar kyleu commented on June 8, 2024

What url do you use? It works for me when running on http://localhost:9000. What cookies do you see set? What is the value of s(ecuredRequest).identity in actions? Thanks again for looking in to this, I hope we can make it work for you!

from play-silhouette-postgres-async-seed.

ajaygeorge91 avatar ajaygeorge91 commented on June 8, 2024

response
Set-Cookie:silhouette_auth=41f...afd12; Max-Age=31536000; Path=/; Domain=http://localhost:9000; HTTPOnly


app conf file

play {
crypto.secret = "YSl...BkJ"
play.i18n.langs = ["en"]

session.cookieName = "silhouette_session"
flash.cookieName = "silhouette_flash"
akka.actor-system = "silhouette"
}

db {
host = "localhost"
database = "mydb"
username = "postgres"
password = "pass"
}

silhouette {
authenticator {
session {
sessionKey = "auth"
encryptAuthenticator = true
useFingerprinting = false
authenticatorIdleTimeout = 600
authenticatorExpiry = 600
}
cookie {
name = "silhouette_auth"
path = "/"
domain = "http://localhost:9000"
secure = false
useFingerprinting = false
maxAge = 31536000 # One year in seconds
#idleTimeout = 31536000 # One year in seconds
expiry = 31536000 # One year in seconds
}
}


request.identity = None

from play-silhouette-postgres-async-seed.

kyleu avatar kyleu commented on June 8, 2024

Hmm. I've run the app on a fresh OS X and Windows 8, and everything works as expected. Are you using the default routes and controller actions?

Play's request.identity is None normally (I'll fix that soon), but if you follow the withSession pattern, you deal with SecuredRequest, which has an identity field that isn't an Option[User], but is a direct User.

from play-silhouette-postgres-async-seed.

kyleu avatar kyleu commented on June 8, 2024

Actually, now that I think about it, withSession doesn't even expose an Option[User] - what type is your request? Using withSession, it should be a SecuredRequest[User].

from play-silhouette-postgres-async-seed.

ajaygeorge91 avatar ajaygeorge91 commented on June 8, 2024

the withSession in BaseController which takes (secureRequest => result) is UserAwareAction.
I put a log in there (request.idendity) and its showing None. So every time when it passes through that request, its creating a new user.

I'm working on linux right now. Will try it in windows and give you the status.
I'm pretty sure that this would be an error caused by misconfiguration or anything. This project is awesome by the way. Good work on the postgres async part. I could just start working directly on this after the fix. :)

from play-silhouette-postgres-async-seed.

bbourget avatar bbourget commented on June 8, 2024

@ajaygeorge91 , your problem is with your cookie domain configuration.

Just use a domain name in development and add it to your hosts file.

add this to your hosts file:
127.0.0.1 myweb.com

Update your cookie configuration:
cookie {
name = "silhouette_auth"
path = "/"
domain = "myweb.com"
secure = false
useFingerprinting = false
maxAge = 31536000 # One year in seconds
#idleTimeout = 31536000 # One year in seconds
expiry = 31536000 # One year in seconds
}

Then browse http://www.myweb.com:9000/ and all should be fine..

from play-silhouette-postgres-async-seed.

ajaygeorge91 avatar ajaygeorge91 commented on June 8, 2024

I will check that. Thank you

Ajay George

On Fri, Aug 28, 2015 at 11:48 PM, bbourget [email protected] wrote:

@ajaygeorge91 https://github.com/ajaygeorge91 , your problem is with
your cookie domain configuration.

Just use a domain name in development and add it to your hosts file.

add this to your hosts file:
127.0.0.1 myweb.com

Update your cookie configuration:
cookie {
name = "silhouette_auth"
path = "/"
domain = "myweb.com"
secure = false
useFingerprinting = false
maxAge = 31536000 # One year in seconds
#idleTimeout = 31536000 # One year in seconds
expiry = 31536000 # One year in seconds
}

Then browse http://www.myweb.com:9000/ and all should be fine..


Reply to this email directly or view it on GitHub
#1 (comment)
.

from play-silhouette-postgres-async-seed.

Related Issues (2)

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.