[JBossWS] - User authorization in Web Service
by ike
How to setup user authentication in a web service? I have something like:
@Stateless
@WebService(endpointInterface="com.m1.sample.core.IRoleMgrWebService")
@SecurityDomain("mydomain")
public class RoleMgrEjbWeb implements IRoleMgrWebService {
...
@AllowedRoles("role")
public void doSomething() {...}
}
The client is like that:
URL url = new URL("http://127.0.0.1:8080/RoleMgrEjbWebService/RoleMgrEjbWeb?wsdl");
QName qname = new QName("http://core.sample.m1.com/", "RoleMgrEjbWebService");
ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService(url, qname);
IRoleMgrWebService ws = (IRoleMgrWebService) service.getPort(IRoleMgrWebService.class);
ws.doSomething();
What should I write to pass user's credentials? I tried something like:
URL url = Thread.currentThread().getContextClassLoader().getResource("auth.conf");
System.setProperty("java.security.auth.login.config", url.toString());
javax.security.auth.login.LoginContext lh = new javax.security.auth.login.LoginContext("aloe",
new AloeLoginHandler("ike", "1"));
lh.login();
But that works only if I call EJB's not service.
Btw, is there any documentation about authentication and authorization in jboss web services?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068118#4068118
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068118
18Â years, 9Â months
[JBoss Seam] - Re: @DataModelSelection and ClassCastException
by yohann49
thanks for your reply...
After some check of my .ear, there's no duplicate import of hibernate... To make some stuff working, I had to add these jars to the glassfish lib directory:
hibernate-all.jar
thirdparty-all.jar
jboss-archive-browsing.jar
In my ear and my war, all the jars i have are :
EAR :
commons-beanutils-1.7.0.jar
commons-collections-3.1.jar
commons-digester-1.6.jar
el-api.jar
el-ri.jar
jboss-seam-debug.jar
jboss-seam.jar
jsf-facelets.jar
WAR (under WEB-INF/lib):
ajax4jsf-1.1.1.jar
jboss-seam-ui.jar
oscache-2.3.2.jar
richfaces-3.0.1.jar
That's a bit weird, because the page before the one which raise the exception contains a DataModel, and it works just fine...
All i have to do is to display in a first page a list of orders you can click on, then display the orderlines relatives to this order and when a user clicks on a orderline, he may see the items that are relative to it. It crashes when the user clicks on the orderline...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4068117#4068117
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4068117
18Â years, 9Â months