草庐IT

directory-security

全部标签

java - Spring-security 甚至在提交表单之前就显示 'Bad Credentials'

我有以下用于springsecurity的代码,但它不起作用。当我打开登录页面并输入用户名/密码admin@myproject.com/secret时,将显示以下错误消息。一旦输入用户名/密码并添加到地址?error=1,即使我手动删除它并刷新页面消息也不会出现。控制台中没有显示任何内容。YourloginattemptwasnotsuccessfulduetoBadcredentials.spring-security.xml表单有以下代码,似乎SPRING_SECURITY_LAST_EXCEPTION在提交表单之前就不是空的。Yourloginattemptwasnotsucce

java - Spring Security/Spring Boot - 如何为用户设置角色

当我使用安全登录时,我无法使用request.isUserInRole()方法。我认为没有设置用户的角色。这是我的安全配置:@Configuration@EnableGlobalMethodSecurity(prePostEnabled=true,securedEnabled=true)@Order(SecurityProperties.ACCESS_OVERRIDE_ORDER)publicclassSecurityConfigextendsWebSecurityConfigurerAdapter{@AutowiredprivateDataSourcedataSource;@Auto

java - Spring Security OAuth2 - @EnableOauth2Sso 但也接受 token 作为身份验证

我有一个应用程序在WebSecurityConfigurerAdapter上有@EnableOAuth2Sso添加@EnableOAuth2Sso后,应用程序将我重定向到授权服务器,并允许在此授权服务器登录后进行访问。我也想提供API访问权限,所以我希望应用程序能够通过Authorization-Header传递访问token来访问我的资源Authorization:bearereyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...我通过与@EnableOAuth2Sso一起使用的身份验证过滤器进行调试时注意到,未检查Authorization-Header值。

java - 如何从 javax.naming.directory.Attribute 中提取值

问题说明了一切。当我打印一个属性时,它是:cn:WF-008-DAM-PS代码片段是:privatevoidsearchGroup()throwsNamingException{NamingEnumerationsearchResults=getLdapDirContext().search(groupDN,"(objectclass=groupOfUniqueNames)",getSearchControls());StringsearchGroupCn=getCNForBrand(m_binder.getLocal("brandId"),m_binder.getLocal("bra

java - spring security 默认登录页面代码位于哪里?

当您使用最简单的配置时,SpringSecurity4中生成的默认登录页面在哪里?...我正在使用这个basicsamplewebapplicationforSpringSecurity.和这个问题差不多Whereisthedefaultloginpageforthespringsecuritycoreplugin?但对于Java。 最佳答案 它是从这个类org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter生成的:pri

java - 线程 "main"java.security.AccessControlException : access denied (java. util.PropertyPermission * 读、写中的异常)

我正在尝试运行一个用javarmi开发的桌面应用程序。当我尝试在Eclipse中执行此应用程序时,出现以下错误。请任何人帮助我提前致谢。Exceptioninthread"main"java.security.AccessControlException:accessdenied(java.util.PropertyPermission*read,write)atjava.security.AccessControlContext.checkPermission(UnknownSource)atjava.security.AccessController.checkPermission

java - 如何在 spring security 中重定向访问被拒绝的页面?

我想知道如何在springsecurity中重定向访问被拒绝的页面?我应该使用某种处理程序还是在web.xml中进行编辑?谢谢 最佳答案 您是否阅读了SpringSecurity手册的相关部分,即AccessDeniedHandler和namespaceappendix.如果你想要更多的控制,你可以使用其中/denied映射到您编写的WebController类。确保/denied/**不protected。如果这不能回答您的问题,能否请您更详细地解释您要实现的目标? 关于java-如何

已解决fatal error: Python.h: No such file or directory

已解决fatalerror:Python.h:Nosuchfileordirectory下滑查看解决方法文章目录报错问题解决思路解决方法交流报错问题fatalerror:Python.h:Nosuchfileordirectory解决思路这个错误通常发生在编译或安装Python扩展模块时,缺少Python.h头文件。解决方法下滑查看解决方法要解决这个问题,你可以按照以下步骤:确保你已经正确安装了Python开发包。在Ubuntu上,可以使用以下命令安装:sudoapt-getinstallpython3-dev如果你使用的是其他操作系统,请确保已安装了对应的Python开发包。可以参考官方文档

java - 使用 Spring Security Filter 锁定除少数路由之外的所有内容

我们正在重新设计我们的产品以删除SpringSecurity中默认的“anonymousUser”行为,并希望锁定除少数端点之外的所有URL(通过过滤器安全性)。我们想不通的是如何指定“锁定除X、Y和Z之外的所有内容”我们的安全设置基本上归结为以下内容:@ConfigurationpublicclassSecurityConfigextendsWebSecurityConfigurerAdapter{@Overrideprotectedvoidconfigure(HttpSecurityhttp)throwsException{http//disableanonymoususers.a

java - spring security - 在 UserDetailsS​​ervice 实现中访问请求参数

我正在开发一个javaspringmvc应用程序。我已经像这样实现了UserDetailsS​​ervice接口(interface):@Component@TransactionalpublicclassSecurityDAOimplementsUserDetailsService{@OverridepublicUserDetailsloadUserByUsername(finalStringusername)throwsUsernameNotFoundException{...}....}我需要在loadUserByUsername方法中找到用户登录url(因为该项目有多个登录ur