[Security & JAAS/JBoss] - Getting Subject in EJB3 Session Bean
by ablevine1
I am trying to access the subject in an ejb3 session bean so that one of the Subject's Principal's can be used for some auditing information.
My subjects have several different principals including emailAddress and subjectID. When I make a call to SecurityAssociation.getSubject from within a session bean method it returns null . How ever, when I make the same call from an interceptor on the session method, the call returns the subject fine. Why then can I not access the subject from within the session bean method itself??
I have also tried using:
Subject subject = (Subject) PolicyContext.getContext("javax.security.auth.Subject.container");
|
but that also returns null.
I also tried calling SecurityAssociation.getPrincipal and from within the session bean method and it works but returns the emailAddress Principal, while the subjectID Principal is the one that I need. Possibly, just getting this call to return the subjectID Principal instead of the emailAddress Principal would also be a viable solution to my problem.
Any suggestions would be appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974728#3974728
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974728
19 years, 7 months
[JBoss Eclipse IDE (users)] - Re: JBoss 4.0.4-GA won't start in Debug mode?
by marvin_taboada
dbs & hebahob:
The dialog is only redundant, choose Continue in the current mode and optionally set flag Remember my decision.. if you don't want the dialog pops up everytime. I haven't found yet a place to reset this flag but you can always stop, restart the server from the JBoss Server View in the mode you like.
See http://jira.jboss.org/jira/browse/JBIDE-363 for information about the resolution.
torben.frojonck:
Your console output is incomplete to understand...
¿Do you get in the last line the following?:
...
[Server] JBoss (MX MicroKernel) [4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200608231025)] Started in 49s:391ms
if the answer is yes, you have already started your server, try accesing via localhost:8080 or 127.0.0.1:8080 first.
If you got a message about Timeout, maybe you have an alpha version, try JBoss Eclipse IDE 2.0.0.Beta1, see the following for instructions:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=89214
If timeout persist (maybe some huge EARs, or WARs), modify the timeout preferences (window -> preferences -> jboss ide -> jboss servers), and even the action when timeout has been reached.
See the following link where Rob explains better its use:
http://jboss.com/index.html?module=bb&op=viewtopic&t=90458
Report bugs, it's still in beta version, but first search in http://jira.jboss.org to see if the bug hasn't already been reported or solved.
Thanks for the good work in JBossIDE!
jmtv
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974723#3974723
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974723
19 years, 7 months
[JBoss Seam] - Does @Role work at instanciation or retrieving a component?
by fhh
I'm not sure if I understand the @Role-Annotation correctly. Can it be used so that one component can be instanciated under two names or retrieved under two names. Imagine I have a component like this:
| @Name("foo")
| @Scope(ScopeType.SESSION)
| @Role(name="bar", scope=ScopeType.CONVERSATION)
| public class Foo {
|
| }
|
Now I instanciate it in a jsf with the name foo by binding an input to it:
| <h:input value="#{foo.test}" />
|
Than I inject this very instance into a SLSB like this?
| @Stateless
| public class FooBarAction {
|
| @In
| Foo foo;
|
| @In
| Foo bar;
|
| public boolean isIdentical() {
|
| return foo == bar;
| }
|
| }
|
So the question is: Would the isIdentical()-Method return true or would it fail because bar is null? While testing it seemed to me that bar is null because the injection does not work. Is this the intended behaviour?
If it is maybe this should be clarified in the documentation.
Regards
fhh
Regards fhh
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3974722#3974722
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3974722
19 years, 7 months