jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sidhama <sidhartha.mal...@wipro.com>
Subject How to configure security module to mysql
Date Fri, 22 May 2009 07:40:29 GMT

Guys, 
I am using the following code for creating users in jackrabbit.But my
requirement is to store these newly created users to mysql, and persist
it.How to go for it.As i am not finding anyway where the created users being
stored by jackrabbit.


-------java code -- for creating user
String userName = request.getParameter("adminUserName");
        String passWord = request.getParameter("adminPassword");
        String catalog = request.getParameter("catalog");
        String read = request.getParameter("cbRead");
        String write = request.getParameter("cbWrite");
        LOG.info("params userName=" + userName + " password=" + passWord + "
catalog=" + catalog + " read=" + read + "write=" + write);
        Repository rep = new TransientRepository();
        Credentials cr = new SimpleCredentials("admin",
"admin".toCharArray());
        sess = (SessionImpl) rep.login(cr);
        Node n = sess.getRootNode().hasNode(catalog) ?
sess.getRootNode().getNode(catalog) : sess.getRootNode().addNode(catalog,
"nt:folder");
        LOG.info("the path of node is" + n.getPath());
        UserManager userManager = sess.getUserManager();
        User user = (User) userManager.getAuthorizable(userName);
        if (user == null)
          user = userManager.createUser(userName, passWord);
-----------------------------------------------

Thanks

-- 
View this message in context: http://www.nabble.com/How-to-configure-security-module-to-mysql-tp23665964p23665964.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.


Mime
View raw message