小编san*_*sto的帖子

如何从Eclipse Build Workspace跳过maven插件执行

我正在使用frontend-maven-plugin,这里有更多信息.

为了在maven构建上运行GRUNT任务,并且因为我正在使用Eclipse,所以每次我在代码中更改某些内容时它都会构建Workspace.

问题是Eclipse构建过程每次都执行maven插件,这使得进程非常慢.所以我想知道如何从Eclipse Build工作区跳过maven插件执行.有任何想法吗?

提前致谢,

java eclipse maven gruntjs

5
推荐指数
2
解决办法
3280
查看次数

如何使基本身份验证作为 Angular JS/Spring 启动应用程序中 keycloak 的替代方案

我们已经在生产环境的项目中从基本身份验证迁移到 Keycloak 方法。但是,我们希望继续使用基本身份验证,用于本地开发、独立和演示安装,这可以由配置文件或类似的东西触发。

在这个项目中,我们有使用 Java/Spring boot 开发的 REST API 和使用这些 API 的 AngularJS 应用程序。我们正在使用 Keycloak 来保护 AngularJS 应用程序和 API。

问题是如何使 Spring Security 和 Keycloak 在具有不同配置文件的同一应用程序中“一起”工作。到目前为止,我找到的解决方案是配置 Spring Security 和 Keycloak,并使用属性文件进行了解决方法,如下所述:

应用程序keycloak.properties

#Unactivate Basic Authentication
security.ignored=/**
Run Code Online (Sandbox Code Playgroud)

应用程序本地auth.properties

#Unactivate Keycloak
spring.autoconfigure.exclude=org.keycloak.adapters.springboot.KeycloakSpringBootConfiguration
Run Code Online (Sandbox Code Playgroud)

当我想使用 keycloak 时,我必须忽略安全性以免出现问题,当我想使用基本身份验证时,我必须排除 Keycloak 配置以防止冲突。

这是我的安全配置类:

@Configuration
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {

@Override
protected void configure(HttpSecurity http) throws Exception {
    http.httpBasic().and()
            .authorizeRequests()
            .antMatchers("/","/scripts/**","/keycloak/isActive","/keycloak/config","/bower_components/**","/views/**","/fonts/**",
                    "/views/inventory/dialogs/**", "/services/**","/resources/**","/styles/**", "/info")

            .permitAll()
            .anyRequest()
            .authenticated()
            .and()
            .csrf().disable();
}


@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
    auth.inMemoryAuthentication().withUser("admin").password("admin").roles("ADMIN"); …
Run Code Online (Sandbox Code Playgroud)

java authentication spring-security spring-boot keycloak

5
推荐指数
1
解决办法
5086
查看次数