@Bean
    protected SaltAwareJdbcRealm jdbcRealm(DataSource dataSource) {

        HashedCredentialsMatcher credentialsMatcher = new HashedCredentialsMatcher();
        credentialsMatcher.setHashAlgorithmName("SHA-256");
        credentialsMatcher.setStoredCredentialsHexEncoded(false);

        SaltAwareJdbcRealm jdbcRealm = new SaltAwareJdbcRealm();
        jdbcRealm.setName("jdbcRealm");
        jdbcRealm.setCredentialsMatcher(credentialsMatcher);
        jdbcRealm.setDataSource(dataSource);

        return jdbcRealm;
    }
Used by the SecurityManager to access security data (users, roles, etc.).
Many other realm implementations can be used too (PropertiesRealm,
LdapRealm, etc.

@param dataSource
@return
samples/spring-mvc/src/main/java/org/apache/shiro/samples/spring/config/ApplicationConfig.java