Examples of updateCredentialByAdmin()


Examples of org.wso2.carbon.user.api.UserStoreManager.updateCredentialByAdmin()

        }
        if (!userStoreManager.isReadOnly() && updatePassword) {
            // now we will update the tenant admin with the admin given
            // password.
            try {
                userStoreManager.updateCredentialByAdmin(tenantInfoBean.getAdmin(),
                        tenantInfoBean.getAdminPassword());
            } catch (UserStoreException e) {
                String msg = "Error in changing the tenant admin password, tenant domain: " +
                        tenantInfoBean.getTenantDomain() + ". " + e.getMessage() + " for: " +
                        tenantInfoBean.getAdmin();
View Full Code Here

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

        try {
            RealmConfiguration realmConfig = new RealmConfigXMLProcessor()
                    .buildRealmConfigurationFromFile();
            UserStoreManager userStore = new JDBCUserStoreManager(ds, realmConfig, 0, true);
            userStore.updateCredentialByAdmin(username, password);
            System.out.println("Password updated successfully.");
        } catch (UserStoreException ex) {
            System.err.println("Error updating credentials for user " + username + " : " + ex);
        }
    }
View Full Code Here

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

     */
    private void updateTenantAdminPassword(UserRealm userRealm, Tenant tenant) throws Exception {
        try {
            UserStoreManager userStoreManager = userRealm.getUserStoreManager();
            if (!userStoreManager.isReadOnly()) {
                userStoreManager.updateCredentialByAdmin(tenant.getAdminName(),
                                                         tenant.getAdminPassword());
                if (log.isDebugEnabled()) {
                    log.debug("Successfully set the password for the tenant.");
                }
            }
View Full Code Here

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

        if (!userStoreManager.isExistingUser("tracker")) {
            userStoreManager.addUser("tracker", "tracker123", null, null, null, false);
            Permission[] permisions = new Permission[] { new Permission("high security", "read")};
            userStoreManager.addRole("tracker_role", new String[] {"tracker"}, permisions);
        }
        userStoreManager.updateCredentialByAdmin("tracker", "tracker123");
        // do some authorizations
        AuthorizationManager authManager = realm.getAuthorizationManager();
        authManager.authorizeRole("tracker_role", "tracker_obj", "read");
    }
}
View Full Code Here

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

        if (!userStoreManager.isReadOnly() && updatePassword) {
            // now we will update the tenant admin with the admin given
            // password.
            try {
                userStoreManager.updateCredentialByAdmin(tenantInfoBean.getAdmin(),
                                                         tenantInfoBean.getAdminPassword());
                isPasswordChanged = true;
            } catch (UserStoreException e) {
                String msg = "Error in changing the tenant admin password, tenant domain: " +
                             tenantInfoBean.getTenantDomain() + ". " + e.getMessage() + " for: " +
View Full Code Here

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

            try {
                String adminName = ClaimsMgtUtil.getAdminUserNameFromTenantId(
                        TenantMgtServiceComponent.getRealmService(), tenantId);
                String password = tenantInfoBean.getAdminPassword();

                userStoreManager.updateCredentialByAdmin(adminName, password);
                log.info("Password reset by the admin for domain: " + tenantDomain);
                return true;
            } catch (UserStoreException e) {
                String msg = "Error in changing the tenant admin password, tenant domain: " +
                             tenantInfoBean.getTenantDomain() + ".";
View Full Code Here

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

        int tenatId = admin.getTenantId("dimuthu");
       
        // authenticate
        assertTrue(admin.authenticate("dimuthu", "credential"));

        admin.updateCredentialByAdmin("dimuthu", "topsecret");
        assertTrue(admin.authenticate("dimuthu", "topsecret"));

        assertTrue(admin.isExistingUser("dimuthu"));
        assertFalse(admin.isExistingUser("muhaha"));
View Full Code Here

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

        }catch(Exception ex){
          //expected user
        }

        //update by ADMIN
        admin.updateCredentialByAdmin("dimuthu", "topsecret");
        assertTrue(admin.authenticate("dimuthu", "topsecret"));

        //isExistingUser
        assertTrue(admin.isExistingUser("dimuthu"));
        assertFalse(admin.isExistingUser("muhaha"));
View Full Code Here

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

        }
        if (!userStoreManager.isReadOnly() && updatePassword) {
            // now we will update the tenant admin with the admin given
            // password.
            try {
                userStoreManager.updateCredentialByAdmin(tenantInfoBean.getAdmin(),
                                                         tenantInfoBean.getAdminPassword());
            } catch (UserStoreException e) {
                String msg = "Error in changing the tenant admin password, tenant domain: " +
                             tenantInfoBean.getTenantDomain() + ". " + e.getMessage() + " for: " +
                             tenantInfoBean.getAdmin();
View Full Code Here

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

     */
    private void updateTenantAdminPassword(UserRealm userRealm, Tenant tenant) throws Exception {
        try {
            UserStoreManager userStoreManager = userRealm.getUserStoreManager();
            if (!userStoreManager.isReadOnly()) {
                userStoreManager.updateCredentialByAdmin(tenant.getAdminName(),
                                                         tenant.getAdminPassword());
                if (log.isDebugEnabled()) {
                    log.debug("Successfully set the password for the tenant.");
                }
            }
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.