shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "rory@mygreenisland.com" <r...@mygreenisland.com>
Subject JDBC Realm access to HttpSession
Date Thu, 24 Nov 2011 17:39:22 GMT
Hi,

I am new to shiro and I'm trying to implement a custom jdbc realm.
In my custom realm class I am extending JdbcRealm and overriding
doGetAuthenticationInfo. 

The problem I have is that our users table allows duplicate usernames shared
across different clients so our query will look like this:
"Select * from users where username=? and client=?;"

I can get the username to pass to the query quite easily from the
AuthenticationToken but I need a way to access the client value also which
is available in a session variable. 
My questions for now are
1) I think if I create a member variable in the class and I'm able to set
that variable before the doGetAuthenticationInfo method is called that would
solve my problem. If this is possible I need to know where I could set the
variable? 

2) Is there an way to  access HttpSession variables in my realm class ?

3) Does anybody have a better solution to this problem?

Thanks,
Rory

--
View this message in context: http://shiro-developer.582600.n2.nabble.com/JDBC-Realm-access-to-HttpSession-tp7028935p7028935.html
Sent from the Shiro Developer mailing list archive at Nabble.com.

Mime
View raw message