[JBoss AS 7 Development] - JBoss AS 7.1.1.Final custom login module for remoting and custom principal
by Sebastian Raue
Sebastian Raue [https://community.jboss.org/people/sraue] created the discussion
"JBoss AS 7.1.1.Final custom login module for remoting and custom principal"
To view the discussion, visit: https://community.jboss.org/message/726343#726343
--------------------------------------------------------------
For remoting we have made a custom login module which extends org.jboss.security.auth.spi.AbstractServerLoginModule.
The overwritten method getIdenttity() returns a custom principal - ApplicationPrincipal.
We can access the principal inside our ejbs via
@Resource
public SessionContext sessionContext;
....
Principal principal = sessionContext.getCallerPrincipal();
....
but we get a ClassCastException when we try to cast the returned Principal into ApplicationPrincipal.
On the other hand principal.getClass().getName() returns the expected class name.
The problem is that our login module is deployed as a jboss module (<jboss-home>/modules) - inside a jar which also
contains ApplicationPrincipal. The ear containing our ejb.jar which contains our ejbs also contains a copy of ApplicationPrincipal.
The problem is that our custom login module and the ApplicationPrincipal are loaded by one class loader and our
ejbs and the ApplicationPrincipal copy are loaded by another class loader. The ApplicationPrincipal from the login module which we get
by calling sessionContext.getCallerPrincipal() in the ejb is no ApplicationPrincipal known by the ejbs.
What can we do to solve this problem?
I have tried to put the custom login module code into our ear and adjusted the "module" attribute value of <login-module>
in our standalone.xml to deployment.<app-name>.ear.<ejb-jar-name>.jar but it did not work. Exception on the remote client was:
javax.security.sasl.SaslException: Authentication failed: all available authentication mechanisms failed
As a separate module and the respective <login-module> configuration in standalone.xml the authentication works fine with our login module
- we only have the described ClassCastException problem.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/726343#726343]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 3 months
[JBoss AS 7 Development] - Grails project on Jboss 7 Blocks logging
by David Pugh
David Pugh [https://community.jboss.org/people/thebravedave] created the discussion
"Grails project on Jboss 7 Blocks logging"
To view the discussion, visit: https://community.jboss.org/message/732536#732536
--------------------------------------------------------------
I have a grails project that I am attempting to get working correctly for my company. We had the project running smoothly on Jboss 4.2.3, but upgrading to Jboss 7 causes a problem. When I deploy the grails war with another ear project in the deployments folder of jboss 7, Jboss stops logging part way through the deploy. Both the grails war and the ear project deploy properly, but logging just doesn't work. Also even after deploy, when I run a webservice that is available from the ear project, the webservice method runs properly, but the logging I added to the webservice method doesn't show up in the logs. If I stop the server and remove the grails project and restart it and run the same webservice method all of the logging shows up, also all of the logging that was supposed to show up during deployment.
I'm not seeing any errors in the logs involving class loader issues. Please someone throw me a bone!
Sincerely,
David
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/732536#732536]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months