Package org.wso2.carbon.user.core

Examples of org.wso2.carbon.user.core.UserStoreManager.updateCredential()


            UserStoreManager userStore = this.realm.getUserStoreManager();
            HttpServletRequest request = (HttpServletRequest) MessageContext
                    .getCurrentMessageContext().getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
            HttpSession httpSession = request.getSession(false);
            String userName = (String) httpSession.getAttribute(ServerConstants.USER_LOGGED_IN);
            userStore.updateCredential(userName, newPassword, oldPassword);
        } catch (UserStoreException e) {
            // previously logged so logging not needed
            throw new UserAdminException(e.getMessage(), e);
        }
    }
View Full Code Here


        assertTrue(admin.isExistingUser("dimuthu"));
        assertFalse(admin.isExistingUser("muhaha"));

        // update
        admin.updateCredential("dimuthu", "password", "topsecret");
        assertFalse(admin.authenticate("dimuthu", "credential"));
        assertTrue(admin.authenticate("dimuthu", "password"));

        String[] names = admin.listUsers("*", 100);
        assertEquals(3, names.length);
View Full Code Here

        assertTrue(admin.isExistingUser("dimuthu"));
        assertFalse(admin.isExistingUser("muhaha"));

       
        // update by USER
        admin.updateCredential("dimuthu", "password", "topsecret");
        //assertTrue(admin.authenticate("dimuthu", "password")); //TO DO
        assertFalse(admin.authenticate("dimuthu", "credential"));
        try{
          admin.updateCredential("dimuthu", "password", "xxx");
          TestCase.assertTrue(false);
View Full Code Here

        // update by USER
        admin.updateCredential("dimuthu", "password", "topsecret");
        //assertTrue(admin.authenticate("dimuthu", "password")); //TO DO
        assertFalse(admin.authenticate("dimuthu", "credential"));
        try{
          admin.updateCredential("dimuthu", "password", "xxx");
          TestCase.assertTrue(false);
        }catch(Exception ex){
          //expected exception
        }
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.