geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weberjn <webe...@gmail.com>
Subject API for nested subjects?
Date Wed, 18 Jul 2012 12:50:06 GMT
Hi,

I still need nested security context, to invoke EJBs from an application
client with changing subjects.

I tried the ContextManager code below, but it does not work, the current
subject is null.
Is there a better code for this?

Thanks, Juergen

See also:
https://issues.apache.org/jira/browse/GERONIMO-4765
https://java2s.com/Open-Source/Java/EJB-Server/geronimo/security/org/apache/geronimo/security/ContextManagerTest.java.htm


context.login();
subject subject = context.getSubject();

ContextManager.registerSubject(subject);
Callers oldCallers = ContextManager.pushNextCaller(subject);
// sowhere other in the call chain
try
{
	Subject subject1 = ContextManager.getCurrentCaller();
	
	System.out.println("getCurrentSubject1() -> " + subject1);
	
	// invoke EJB here under subject1
}
finally
{
	ContextManager.popCallers(oldCallers);
}

getCurrentSubject1() -> null



--
View this message in context: http://apache-geronimo.328035.n3.nabble.com/API-for-nested-subjects-tp3985483.html
Sent from the Users mailing list archive at Nabble.com.

Mime
View raw message