小编Nat*_*Far的帖子

在一个命令中提取多个 jar

我有很多 (20) 个 jar 文件的文件夹。有没有办法在终端的一个命令中提取所有这些罐子,而不是一个一个地做?我正在使用MAC。

java unix terminal zip jar

3
推荐指数
1
解决办法
2002
查看次数

我的自定义过滤器中的 AuthenticationManager 为空

我的自定义过滤器基于UsernamePasswordAuthenticationFilter需求,AuthenticationManager但每次我调用该方法时,attemptAuthentication()编译都会失败:

Authentication auth2 = this.getAuthenticationManager().authenticate(authRequest);
Run Code Online (Sandbox Code Playgroud)

AuthenticationManager空:

java.lang.NullPointerException: null
    at app.shellx.security.CustomUsernamePasswordAuthenticationFilter.attemptAuthentication(CustomUsernamePasswordAuthenticationFilter.java:75) ~[classes/:na]
Run Code Online (Sandbox Code Playgroud)

网络安全配置

@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(securedEnabled = true)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    @Autowired
    UserService userService;

    @Autowired
    private JwtTokenFilter jwtTokenFilter;

    @Autowired
    private CustomAuthenticationSuccessHandler customAuthenticationSuccessHandler;

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
            .httpBasic().disable()
            .addFilterBefore(jwtTokenFilter, UsernamePasswordAuthenticationFilter.class)
            .sessionManagement()
            .sessionCreationPolicy(SessionCreationPolicy.STATELESS)
                .and()
            .cors().and()
            .csrf().disable()
            .authorizeRequests() // .antMatchers("/**")
                .antMatchers("/login/**", "/register/**").permitAll()
                .antMatchers("/admin/**").hasRole("ADMIN")      
                .anyRequest().authenticated()
                .and()
            //.csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse());
            .addFilterAt(new CustomUsernamePasswordAuthenticationFilter(), UsernamePasswordAuthenticationFilter.class)  
            .formLogin()
                .loginPage("http://localhost:4200/login")//.failureUrl("/login-error")
                .loginProcessingUrl("/login") 
                .usernameParameter("email")
                .successHandler(customAuthenticationSuccessHandler)
                .and()
            .logout() 
                .permitAll();
    } …
Run Code Online (Sandbox Code Playgroud)

java security authentication spring spring-security

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

元素“context:annotation-config”的前缀“context”未绑定

我正在尝试使用注释来使我的 Spring 应用程序正常工作。但我收到一个错误:未找到元素“context:annotation-config”的前缀“context”。

谁能说出这的根本原因是什么。

spring

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

标签 统计

java ×2

spring ×2

authentication ×1

jar ×1

security ×1

spring-security ×1

terminal ×1

unix ×1

zip ×1