草庐IT

row-level-security

全部标签

java - 使用带有 hdbc 的 spring security 3.0 逐步登录示例

我是Spring和SpringSecurity的新手。我只需要一个指向正确方向的指针:我有一个简单的SpringMVC/SpringSecuritywebapp。我想将登录功能添加到网络应用程序中。我创建了以下两个表。CREATETABLE"users"("USER_ID"NUMBER(10)NOTNULL,"USERNAME"VARCHAR(45)NOTNULL,"PASSWORD"VARCHAR(45)NOTNULL,"ENABLED"NUMBER(1)NOTNULL,PRIMARYKEY("USER_ID"))CREATETABLE"user_roles"("USER_ROLE_

java - Spring Security getPrincipal() 方法返回 anonymousUser

在我的springweb应用程序中,我想在我的Controller中获得一个经过身份验证的用户:Objectprincipal=SecurityContextHolder.getContext().getAuthentication().getPrincipal();但是主体的值是“anonymousUser”,尽管我已经登录了。如何获得经过身份验证的用户?我在spring-security.xml中的配置: 最佳答案 不确定我是否理解,但试试这个 关于java-SpringSecuri

java - chalice /hibernate : No row with the given identifier exists

我有一个域名如下:classAuthor{StringidstatichasMany=[accounts:Account]staticbelongsTo=Accountstaticmapping={accountsjoinTable:[name:"SOMETABLE",key:'SOMEFIELD'],ignoreNotFound:true}staticconstraints={}}没有找到记录时出现以下错误。我试过ignoreNotFound,它不起作用。errormessage:accounts=org.hibernate.ObjectNotFoundException:Norow

java - “Your security settings have blocked a local application from running” Java 8

我正尝试在我的Chrome窗口中运行一个小程序,但收到错误消息。我确实看到所有回复都告诉我将我的安全级别更改为中等,但版本8中不存在该选项。到目前为止,几个小时的谷歌搜索和向同学寻求帮助都没有取得任何进展。谁能给我点建议? 最佳答案 Medium在Java8u20中被移除:Medium(removedfromJava8Update20andlaterversions)Onlyunsignedapplicationsthatrequestallpermissionsareblocked.Allotherapplicationsarea

java - Null GrantedAuthority 获取 Spring Security 的 UserDetails

这是我在springsecurity中的UserDetails服务:publicclassUserDetailimplementsUserDetailsService{@AutowiredUser_serviceuser_service;@OverridepublicUserDetailsloadUserByUsername(StringuserId)throwsUsernameNotFoundException{booleanenabled=true;booleanaccountNonExpired=true;booleancredentialsNonExpired=true;boo

java - 自定义 Spring Security OAuth 2 响应

在我的Java应用程序中,我使用了SpringSecurityOAuth2library实现OAuth提供程序。对成功身份验证的响应(对于authorization_code授予类型)类似于:{"access_token":"d179bf70-aa40-4df9-a3e1-440e835c273a","expires_in":"43199","refresh_token":"879e7bd0-5e0f-48a9-b64d-f61d5665bf4e","scope":"read","token_type":"bearer"}有没有办法为这个响应添加额外的属性,例如用户名或电子邮件地址?

java - Spring 安全抛出 javax.servlet.ServletException : Could not resolve view with name 'j_spring_security_check'

我正在尝试将具有自定义登录页面和数据库访问的Springsecurity添加到我的SpringMVC应用程序中。似乎我的映射是错误的,因为它无法映射j_spring_security_check。为了解决这个问题,我查看了以下页面1、2、3但仍无法解决问题。如果您没有太多时间,请阅读下面的第2部分,这是问题的编辑部分开始的地方。否则,请阅读第1部分和第2部分。第1部分我还在我的web.xml文件中添加了以下行,但应用程序返回以下异常。springSecurityFilterChainorg.springframework.web.filter.DelegatingFilterProxy

java - JSR303 : Trying to customize a constraint violation to be associated with a sub-path in a class-level relationship constraint validator

我正在使用JSR303并创建了一个类级别的约束,用于比较表单中的密码及其确认,我将在此处命名为@SameAs约束。理想情况下,我希望将约束与预期目标(confirmPassword)相关联,但显然封闭的bean不可用于提取密码prop。-因此是类级约束。我感兴趣地阅读了其他展示如何利用类级约束来验证关系的帖子,但找不到任何解释如何自定义约束违规以与子路径相关联的内容,在本例中为关系中的两个字段。我的问题如下:如何将违反约束的消息与“confirmPassword”字段而不是顶级对象相关联?我尝试使用javax.Validator.validate(target,context)的上下文

java - Spring Security 3.2.0.RC1 - <http> 元素和弃用的方法

在升级到SpringSecurity3.2.0.RC1后,我收到关于的警告“方法‘setFilterProcessesUrl’被标记为已弃用”在我的xml配置中。即使是非常简单的配置,我也会收到此警告:根据SpringSecurity3.2APIdocumentationsetFilterProcessesUrl已弃用,应改用setRequiresAuthenticationRequestMatcher(RequestMatcher)。如何更改此基本XML配置,使其不使用已弃用的方法?我正在使用EclipseKepler和SpringToolSuite插件。更新:如果我删除并添加到ht

java - 使用 Apache CXF 的 WS-Security UsernameToken

我有一个与SOAP服务交互的Java应用程序。我使用WSDL通过CXF生成一个java客户端,但我需要使用ws-security来验证我的调用。我正在寻找一种仅代码方式来执行此操作,并且我没有任何xml配置。这是我尝试过的:Mapctx=((BindingProvider)port).getRequestContext();ctx.put("ws-security.username","joe");ctx.put("ws-security.password","joespassword");port.makeSoapCall();但我收到无效WS-Securityheader的解析错误