【发布时间】:2015-06-06 04:57:22
【问题描述】:
我并不是真正的 Java 开发人员,但一个客户项目要求我这样做,所以我可能遗漏了一些明显的东西。
我正在使用 SpringBoot,当应用程序在本地机器和测试服务器上的 Tomcat 中运行时,一切正常。但是,一旦将应用程序部署到 Weblogic,就好像所有路由都可访问,根本没有安全性。登录和注销路由也不存在。
话虽如此。其他一切似乎都可以正常工作,只是根本没有任何安全措施。
我无权访问 Weblogic,因为客户端是部署代码的人,但他们告诉我们它在 12c 上运行。我可以做些什么来解决这个问题?
这是我的 Application.java 中的相关配置:
/**
* The type Authentication security.
*/
@Order(Ordered.HIGHEST_PRECEDENCE)
@Configuration
protected static class AuthenticationSecurity extends GlobalAuthenticationConfigurerAdapter {
/**
* The Users.
*/
@Autowired
private Users users;
/**
* Init void.
*
* @param auth the auth
* @throws Exception the exception
*/
@Override
public void init(AuthenticationManagerBuilder auth) throws Exception {
auth.userDetailsService(users).passwordEncoder(new BCryptPasswordEncoder());
}
}
/**
* The type Application security.
*/
@Order(SecurityProperties.ACCESS_OVERRIDE_ORDER)
protected static class ApplicationSecurity extends WebSecurityConfigurerAdapter {
/**
* Configure void.
*
* @param http the http
* @throws Exception the exception
*/
@Override
protected void configure(HttpSecurity http) throws Exception {
// @formatter:off
http.authorizeRequests()
.antMatchers("/vendor/*","/public/**/*","/partners/*","/events/*", "/login").permitAll()
.anyRequest().fullyAuthenticated().and().formLogin().loginPage("/login")
.and().logout()
.logoutRequestMatcher(new AntPathRequestMatcher("/logout")).and()
.exceptionHandling().accessDeniedPage("/access?error");
// @formatter:on
}
}
提前致谢。
【问题讨论】:
-
希望本文档对您有所帮助 - docs.oracle.com/cd/E24329_01/web.1211/e24975/…
-
@Mithun 谢谢,但我不想使用 Weblogic 安全性。
标签: java spring spring-security spring-boot weblogic12c