ICode9

精准搜索请尝试: 精确搜索
  • Spring Security 4升级后已禁用java.lang.NoSuchMethodError org.springframework.web.servlet.tags.form.InputTa2019-11-19 05:29:20

    我们将应用程序从Spring Security 3升级到了Spring Security 4. 除了使用带有只读或禁用属性的输入标签访问视图时,它还可以正常工作. 例如,当尝试显示违规形式之一时,将引发以下异常: [org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.NoSuchMeth

  • Grails 3 Spring Security覆盖登录表单2019-11-19 03:29:06

    我从spring文档中发现了一些可以覆盖登录控制器和表单的内容.我只想覆盖登录表单本身,同时保留默认控制器.我找到了这个: In the grails security plugin, the login gsp page is located at grails-app/views/login/auth.gsp and the controller at grails-app/controllers/grail

  • java-在春季启动时将UsernameNotFoundException抛出为4032019-11-18 23:20:20

    我有一个春季启动项目.使用不正确的用户凭据发出请求时: catch (RuntimeException ex) { log.error("Error occurred while fetching user {}: {}", securityPrincipal, ex); throw new UsernameNotFoundException("Could not find user: " + securityPrincipal);

  • java-Spring安全性-自定义ExceptionTranslationFilter2019-11-18 18:20:12

    此问题实际上与此问题problem有关. 根据@ harsh-poddar的建议,我相应地添加了过滤器. 但是,在添加之后,即使使用有效的凭据,我似乎也无法登录. 以下是相关代码: 安全配置 @EnableWebSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { // @Bean // p

  • Spring Security maxSession不起作用2019-11-18 14:19:41

    当用户超过maxSession计数时,我想防止登录.例如,每个用户只能登录一次.然后,如果登录的用户尝试使用其他登录系统,则应禁用该用户的登录. .sessionManagement() .maximumSessions(1).expiredUrl("/login?expire").maxSessionsPreventsLogin(true) .sessionRegistry(sessionRegistr

  • Spring集成:SecurityContext传播2019-11-18 12:19:58

    我对Spring Integration中的SecurityContext传播有些困惑. 这是文档的重点: http://docs.spring.io/spring-integration/reference/htmlsingle/#security-context-propagation 我的困惑如下: (1) To be sure that our interaction with the application is secure, according to

  • java-单页应用程序.模板管理的安全性2019-11-18 10:10:20

    在我的应用程序中,我具有单页WEB-UI(AngularJS)和服务器其余服务.服务器使用Spring Boot实现,使用Java注释配置,安全性已打开.我可以使用基于安全限制角色的服务器来管理其余响应. 角度控制器模板的类似问题.对于相同的请求,如果角色不同,则服务器应返回不同的角度模板. 最后一个问

  • java-Cookie的SetSecure为true2019-11-18 08:11:35

    我正在尝试使用SetSecure作为true创建cookie.这在保存或更新方法以及系统重定向到错误页面/抛出403错误时造成了问题.如果我删除SetSecure,则工作正常. Cookie ck= new Cookie("key",value); ck.setsecure(true); response.addCookie(ck);// HttpResponse Q1)可以将安全标志设置

  • 春季-未找到类WebSecurityExpressionHandler2019-11-18 07:19:40

    我试图找出百里香模板中的Spring安全注释.我添加了依赖项: <dependency> <groupId>org.thymeleaf</groupId> <artifactId>thymeleaf</artifactId> <version>3.0.1.RELEASE</version> </dependency> <depend

  • java-Spring Security-除非通过mappableAuthorities指定,否则在HttpServletRequest中不可访问的角色2019-11-18 04:20:43

    我有一个在Tomcat应用程序服务器上运行并针对第三方IdP进行身份验证的Spring Boot Web应用程序. 目前,我们在许多应用程序中使用< security-role>进行基于角色的身份验证.和< security-constraint>在web.xml中,并且可以正常工作. 现在,尝试使用Spring Security,我添加了以下配置类:

  • java-Spring Security fullyAuthenticated()和hasRole(“ ADMIN”)2019-11-12 01:20:15

    我想保护我的应用程序的安全,以便对某些URL进行完全身份验证的任何人都可以访问,并且可以对admin URL进行访问,而对admin用户也可以进行完全认证. 但是现在,我无法找到一种将完全Authenticaded()和hasrole()一起使用的方法. @Override public void configure(HttpSecurity http) t

  • 如何配置Spring Boot和Spring Security以支持表单登录和Google OAuth2登录2019-11-12 00:20:07

    我正在努力用Spring Security配置Spring Boot应用程序以支持两种登录机制:表单登录和Google OAuth2登录. 我想要一个带有传统登录表单的登录页面.该页面上还会有一个“使用Google身份验证按钮”. 登录表单是默认的登录方法,也就是说,当尝试访问受保护的资源时,login.jsp将呈现.用户

  • 使用oauth2范围代替角色来保护弹簧执行器管理端点2019-11-11 18:19:35

    我最近已升级到Spring Cloud Dalston,这意味着Spring Boot 1.5.1,并且我无法再通过检查oauth2范围来保护管理端点.它曾在Spring Cloud Camden中工作. 这是之前起作用的配置: @Configuration public class SecurityConfiguration extends ResourceServerConfigurerAdapter { @V

  • 春季安全块websocket(sockjs)2019-11-11 15:20:52

    在我的一个项目中,我同时配置了REST服务和Websocket,都通过了Spring安全过滤器来检查JWT.对于客户端上的Websocket,应用程序使用sockjs& stomp(在Angular2上)和服务器端的Spring websocket(Tomcat 8).当我在启用Spring安全性的情况下打开连接时,打开连接两秒钟后出现错误.但是,当我

  • java-带有client_credentials错误的Oaut2RestTemplate(不允许匿名)2019-11-11 11:11:50

    我正在尝试使用ResourceServerConfigurerAdapter(带有Oauth2 client_credentials)访问受Spring Security保护的Web服务 以下是安全性配置 //Micoservice 1 @Configuration @EnableResourceServer class ResourceServerConfiguration extends ResourceServerConfigurerAdapter {

  • java-Spring Security 4阻止并发登录不起作用2019-11-11 08:12:53

    我正在尝试在spring-security4中使用自定义User和UserDetails进行基于表单的用户登录.我希望防止同一用户同时登录(因此该用户只能在1台设备上登录). 但是,如果我使用两种不同的浏览器,则可以使用同一用户帐户使用这两种浏览器登录(不需要). 我发现了一些类似的问题和解决方案,但不

  • Spring Security Oauth-OAuth2Exceptions的自定义格式2019-11-11 07:22:04

    Spring Security oauth的错误格式符合OAuth规范,看起来像这样. { "error":"insufficient_scope", "error_description":"Insufficient scope for this resource", "scope":"do.something" } 尤其是在资源服务器上,我发现对于身份验证问题使用不同

  • java-在某些页面上进行Spring安全性重新认证2019-11-11 07:11:34

    当用户在特定页面上执行一些非常敏感的操作时,是否有任何方法可以强制使用Spring安全性进行重新认证?解决方法:采用 SecurityContextHolder.clearContext(); 要么 SecurityContextHolder.getContext().setAuthentication(null); 和 HttpSession session = request.getSession(f

  • java-@Value中的SpEL重构(加密属性)2019-11-10 17:03:00

    我有一个Spring Security配置,必须使用加密的属性.我有实用程序静态方法PasswordUtil.decode(),通过它可以解码属性以进一步使用. 以下解决方案有效,但是特定的SpEL在我看来很难看.因此,我的问题是:是否可以将给定的SpEL表达式重构为更好/更短/更惯用的东西? @Configuration @Enable

  • java-为什么我的SecurityWebFilterChain没有被调用?2019-11-10 15:29:36

    我刚刚开始学习Spring的新反应式编程模型,因此我试图编写一个非常基本的Web服务. 这是我的应用程序配置: @SpringBootApplication @EnableWebFluxSecurity public class ReactiveSpringApplication { public static void main(final String[] args) { SpringApplicati

  • java-如何使用邮递员将用户登录详细信息传递给Spring Boot Rest API2019-11-09 06:02:21

    我正在使用Spring Boot Rest创建一个API,我想限制该API,以便只有登录的用户才能访问它.现在测试我正在使用邮递员的API,但是如何将用户详细信息传递给API? 这是我的代码: @Configuration public class SpringSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired

  • 春季安全配置anyRequest().authenticated()无法按预期工作2019-11-09 04:19:43

    我对Spring Security的配置http.anyRequest().authenticated()的理解是,任何请求都必须经过身份验证,否则我的Spring应用程序将返回401响应. 不幸的是,我的spring应用程序没有这种行为,但是允许未经身份验证的请求通过. 这是我的春季安全配置: @Configuration @Order(1) public cla

  • java-Spring Security getAuthenticationManager()在自定义过滤器中返回null2019-11-08 17:20:18

    我试图在Spring中实现一个非常简单的自定义身份验证过程示例,以更好地理解该概念. 我以为我现在已经准备好了一切,但是发送了一个请求以测试我实现了什么,结果导致NullPointerException可以追溯到 this.getAuthenticationManager()在我的自定义过滤器中返回null.但是我不明白为什么

  • java-基于选择的AuthProvider Spring Security2019-11-08 12:01:22

    我已将Spring安全性配置为可与LDAP和基于DB的登录一起使用.首先,它尝试通过LDAP登录,如果没有所需的权限,则进入用户名/密码输入页面. <security:http auto-config="false" entry-point-ref="loginUrlAuthenticationEntryPoint"> <security:custom-filter ref="customPreAuthF

  • java-“拒绝设置不安全的标头’Cookie’”,同时在angular 6中发送带有GET请求的cookie2019-11-08 10:01:47

    我正在使用angular 6的spring security.当我使用基本的Auth服务器登录时,会发送带有响应的Cookie JessionID.我想将此Cookie与其他请求一起发送以进行身份​​验证,但它给我错误拒绝设置不安全的标头“ Cookie”.当我从邮递员在标头中使用相同的cookie击中相同的端点时,它可以工作.

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有