[Security & JAAS/JBoss] - Need help in JAAS authentication / authorization in web appl
by limnin
Hi, all.
After perusing lots of posts, wikis and docs I'm still stuck with the next problem. I have my EJB3 application deployed to JBoss, security domain and the roles for beans methods all are correctly defined. I have my web application which consists of some AJAX (GWT) code which interacts with my EJB application via transparent servlet calls, i.e. JavaScript make calls to servlets and servlets asks beans for favor. The security domain for web application is configured to be the same as for EJB.
The security domain is configured to have two login modules: ClientLoginModule (first in order, required) and DatabaseServerLoginModule (second in order, required) which has it's queries defined.
As recommended in one of server topics, I have a filter which does programmatic login. It seeks if the servlet session contains login and... :(((... password, and if yes initializes LoginContext, providing callback handler with corresponding information, and calls login() method. In case when session doesn't contain that information, it does nothing and the call continues.
Also I have special servlet method which performs log in for the username and password provided. In success case it puts login and... :(((... password into the session for the filter to use.
All that stuff works. But I don't want to store anything in my servlet session. I'd rather want to be authenticated only once, to get user roles defined only once and to be correctly authorized each time I make a call to secured bean method afterwards.
And I've absolutely stuck with that task. Could anyone help with explanation - I'm absolutely sure that this task is very common one?
Thanks in advance.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035591#4035591
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035591
19 years
[EJB 3.0] - Re: need some help for session bean web service
by shupingChen
when i use the axis to rewrite my ws client, i have another problem:
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: org.xml.sax.SAXParseException: Premature end of file.
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Premature end of file.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at csp.jx.ws.test.TestByJNDI.main(TestByJNDI.java:27)
{http://xml.apache.org/axis/}hostname:lanneret
org.xml.sax.SAXParseException: Premature end of file.
at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:701)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at csp.jx.ws.test.TestByJNDI.main(TestByJNDI.java:27)
Caused by: org.xml.sax.SAXParseException: Premature end of file.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
... 9 more
my client code :
| package csp.jx.ws.test;
|
| import java.net.MalformedURLException;
| import java.net.URL;
| import java.rmi.RemoteException;
|
| import javax.xml.namespace.QName;
| import javax.xml.rpc.ServiceException;
|
| import org.apache.axis.client.Call;
| import org.apache.axis.client.Service;
|
| public class TestByJNDI {
|
| /**
| * @param args
| */
| public static void main(String[] args) {
| try {
| String endpoint = "http://localhost:8080/ejb3test/HelloBean";
| Service service = new Service();
| Call call = (Call)service.createCall();
|
| call.setTargetEndpointAddress(new URL(endpoint));
| call.setOperationName(new QName("http://stateless.session.examples","hello"));
|
| String ret = (String)call.invoke(new Object[]{});
|
| System.out.println(ret);
| } catch (MalformedURLException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| } catch (ServiceException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| } catch (RemoteException e) {
| // TODO Auto-generated catch block
| e.printStackTrace();
| }
| }
|
| }
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4035582#4035582
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4035582
19 years