Well I'm working on this small test app:
Basically I have a secured SessionBean I'd like to call.
Now I have my Servlet setup to
have
lc = new LoginContext(d,new UsernamePasswordHandler(u,p.toCharArray()));
after that I do something like:
TestUtil.getLocalHome().create();
I get a securityexception. Because I do not have the required roles.
To the Bean I seem to be Guest. Wich is the fallback account. And the one I
logged in with was root
I did verfy that my login did work and containd all the required roles.
So, do I have missed somthing?
here's the code
| protected void doGet(HttpServletRequest req, HttpServletResponse resp)
| throws ServletException,
| IOException {
| LoginContext lc = null;
| resp.setContentType("text/html");
| resp.getWriter().println("<html><head><title>Stub
Test</title></head><body>");
| resp.getWriter().println("<h1>JAAS / ACL Test</h1>");
| try {
| // LOGIN
|
| try {
| lc = new LoginContext("domain",new
UsernamePasswordHandler("root","password".toCharArray()));
| lc.login();
| TestUtil.getLocalHome().create();
| lc.logout();
| } catch (LoginException e) {
| System.out.println("login Failed");
| }
| } catch (CreateException e) {
| e.printStackTrace(resp.getWriter());
| } catch (NamingException e) {
| e.printStackTrace(resp.getWriter());
| } catch (FinderException e) {
| e.printStackTrace(resp.getWriter());
| } catch (Exception e) {
| e.printStackTrace(resp.getWriter());
| }
| resp.getWriter().println("</body></html>");
| }
|
kindest regards,
Moritz Angermann
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3887749#3887749
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3887749
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user