geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juergen Weber <webe...@gmail.com>
Subject Re: NPE in ContextManager.getCurrentContext
Date Sun, 26 Jul 2009 10:36:08 GMT


djencks wrote:
> 
> 
> Geronimo uses the AccessControlContext for the Subject to evaluate  
> security decisions.  So, you need to get Geronimo to compute and store  
> this ACC for you.
> [..]
> 

Well, the methodname pushNextCaller suggests that it would do that. Anyway,
with the code below it works now. 

This code should be in Geronimo itself, I created GERONIMO-4765.

Thanks,
J├╝rgen



SimpleCallbackHandler handler = new SimpleCallbackHandler(
		user, password.toCharArray());

LoginContext lc = new LoginContext("geronimo-admin", handler);
lc.login();

Subject subject = lc.getSubject();
System.out.println("lc.getSubject: " + subject);


ContextManager.registerSubject(subject);
Callers oldCallers = ContextManager.pushNextCaller(subject);
try
{
	s1 = secured3Bean.secureMethod(input);
}
finally
{
	ContextManager.popCallers(oldCallers);
}

-- 
View this message in context: http://www.nabble.com/NPE-in-ContextManager.getCurrentContext-tp24645453s134p24665808.html
Sent from the Apache Geronimo - Users mailing list archive at Nabble.com.


Mime
View raw message