kylin添加用户

kylin添加用户

本文主要参考:http://www.cnblogs.com/en-heng/p/5170876.html

1、首先需要编一个小程序来处理加密的问题:
下面是我的pom文件:

        
            junit
            junit
            3.8.1
            test
        
        
            org.springframework.security
            spring-security-core
            4.0.0.RELEASE
        
        
        
            commons-logging
            commons-logging
            1.2
        

    
    
        
            
                org.apache.maven.plugins
                maven-compiler-plugin
                
                    1.8
                    1.8
                    utf-8
                
            
            
                maven-assembly-plugin
                3.0.0
                
                    
                        
                            com.security.tool.App
                        
                    
                    
                        jar-with-dependencies
                    
                
                
                    
                        make-assembly 
                        package 
                        
                            single
                        
                    
                
            
        
    


编写程序,实现加密功能:
package com.security.tool;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        org.springframework.security.crypto.password.PasswordEncoder encoder
                = new org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder();
        try {
            String ycode = args[0];
            String encodedPassword = encoder.encode(ycode);
            System.out.println("原始密码:");
            System.out.println(ycode);
            System.out.println("加密后:");
            System.out.println(encodedPassword);
        } catch (Exception e) {
            System.out.println("请输入要加密的内容");
        } finally {
        }
    }
}

打包后在命令行测试执行:


2、目前kylin采用的是testing的认证方式,认证方式是在$KYLIN_HOME/conf/kylin.properites文件中进行配置的,默认情况下使用的是testing的方式:
kylin.security.profile=testing

我们需要在$KYLIN_HOME/tomcat/webapps/kylin/WEB-INF/classes/kylinSecurity.xml文件中添加用户。

如图,我们添加了用户名为A,密码为:123(加密过)的用户。
kylin添加用户_第1张图片

3、重新启动kylin,使用新的用户名和密码登录。

4、重新登录后发现能够正常登录。

最后附上加密的小工具的地址:
http://download.csdn.net/detail/wild46cat/9831543

你可能感兴趣的:(kylin)