Re: Getting user role membership without context

2017-08-16 Thread Alex O'Ree
Mark, spot on! My ldap setup was incorrect, the group/role i was expecting was in an OU that was not included in the roleSearchBase. After that was resolved, i'm good to go. Thanks for your help On Tue, Aug 8, 2017 at 2:44 AM, Mark Thomas wrote: > Personally, I'd step through the JNDIRealm with a

Re: Getting user role membership without context

2017-08-07 Thread Mark Thomas
Personally, I'd step through the JNDIRealm with a debugger (I use Eclipse) to see exactly what is going on. If you aren't set up for that, enabling debug logging for the JNDIRealm should provide some insight but it might not answer everything. Mark On 04/08/17 21:24, Alex O'Ree wrote: > Rehashin

Re: Getting user role membership without context

2017-08-04 Thread Alex O'Ree
Rehashing this. "Works" was working with the out of the box tomcat-users.xml file. When incorporating a JNDI/Ldap setup, I'm not getting the expected result. Server.xml setup Realm - UserLockOutRealm -- JDNIRealm -- UserRoleRealm (paraphrasing here, this is the default xml file thing) Consider th

Re: Getting user role membership without context

2017-07-19 Thread Alex O'Ree
Got it to work! Thanks Mark! On Wed, Jul 19, 2017 at 10:40 AM, Mark Thomas wrote: > On 19/07/17 15:34, Alex O'Ree wrote: >> Context.findChild and findChildren returns an instance of "Container". >> It looks like StandardWrapper extends Container, so I should be able >> to type cast it. The questi

Re: Getting user role membership without context

2017-07-19 Thread Mark Thomas
On 19/07/17 15:34, Alex O'Ree wrote: > Context.findChild and findChildren returns an instance of "Container". > It looks like StandardWrapper extends Container, so I should be able > to type cast it. The question is, is it always going to be an instance > of StandardWrapper? For a Context, it shou

Re: Getting user role membership without context

2017-07-19 Thread Alex O'Ree
Context.findChild and findChildren returns an instance of "Container". It looks like StandardWrapper extends Container, so I should be able to type cast it. The question is, is it always going to be an instance of StandardWrapper? On Tue, Jul 18, 2017 at 6:40 PM, Mark Thomas wrote: > On 18/07/17

Re: Getting user role membership without context

2017-07-18 Thread Mark Thomas
On 18/07/17 23:21, Alex O'Ree wrote: > Nice, any idea which method I need to call? You already have the Context so you want Context.findChildren() for a list of all the Wrappers (and it is the wrapper object you need) or Context.findChild(String) for a specific Wrapper if you know the name. Th

Re: Getting user role membership without context

2017-07-18 Thread Alex O'Ree
Nice, any idea which method I need to call? On Jul 18, 2017 3:54 PM, "Mark Thomas" wrote: > On 18/07/17 17:41, Alex O'Ree wrote: > > Alright, quick update on this. > > > > At this point, I have servlet context and a username running off the > > main tomcat http threads (quartz job) > > > >> Stan

Re: Getting user role membership without context

2017-07-18 Thread Mark Thomas
On 18/07/17 17:41, Alex O'Ree wrote: > Alright, quick update on this. > > At this point, I have servlet context and a username running off the > main tomcat http threads (quartz job) > >> StandardContext tomcat;load from reflection from ApplicationContext from >> ServletContext as Applicatio

Re: Getting user role membership without context

2017-07-18 Thread Alex O'Ree
Alright, quick update on this. At this point, I have servlet context and a username running off the main tomcat http threads (quartz job) > StandardContext tomcat;load from reflection from ApplicationContext from > ServletContext as ApplicationContextFacade > Realm realm = tomcat.getRealm()

Re: Getting user role membership without context

2017-07-16 Thread Alex O'Ree
bugger, this time replying with the correct reply address. Not sure if the previous reply went through. Awesome thanks for the pointer. For the reflection mechanism. I think i have a working solution, so long as the tomcat dev's don't change the name of the private context variables in Applicatio

Re: Getting user role membership without context

2017-07-16 Thread Alex O'Ree
Awesome thanks for the pointer. For the reflection mechanism. I think i have a working solution, so long as the tomcat dev's don't change the name of the private context variables in ApplicationContextFacade and ApplicationContext I'll also further investigate the JMX/Mbean method with JNDI as it

Re: Getting user role membership without context

2017-07-16 Thread Mark Thomas
On 16/07/17 15:31, Alex O'Ree wrote: > Thanks for the clarification. To add to my description > > I'm running a task on the users behalf on a background thread with a > task scheduler. I need to get the roles when the task is ran in case > of a change in role membership between the time the t

Re: Getting user role membership without context

2017-07-16 Thread Alex O'Ree
Thanks for the clarification. To add to my description I'm running a task on the users behalf on a background thread with a task scheduler. I need to get the roles when the task is ran in case of a change in role membership between the time the task is scheduled and when it is executed. It l

Re: Getting user role membership without context

2017-07-15 Thread Alex O'Ree
I'm running a task on the users behalf on a background thread with a task scheduler. I need to get the roles when the task is ran in case of a change in role membership between the time the task is scheduled and when it is executed. What class reads server. Xml and creates the realms? Perhaps the

Re: Getting user role membership without context

2017-07-15 Thread tomcat
On 15.07.2017 00:46, Alex O'Ree wrote: Hi Tomcat folks! I have a use case where i have reoccuring background process (quartz job) that needs to perform access control checks against a user prinicple. Normally, user role membership is only accessible via one of the http session, servlet request,

Getting user role membership without context

2017-07-14 Thread Alex O'Ree
Hi Tomcat folks! I have a use case where i have reoccuring background process (quartz job) that needs to perform access control checks against a user prinicple. Normally, user role membership is only accessible via one of the http session, servlet request, objects, etc. Question, is there a way t