【java-Spring Boot / Spring Security,登录表单,密码检查】教程文章相关的互联网学习教程文章

Java Applet java.security.AccessControlException【代码】

我正在开发一个可打印文件的Java小程序.小程序是“自签名的”. 打印功能为://argFilePath : path to file (http://localhost/Teste/pdf1.pdf) //argPrintService : something like PrintServiceLookup.lookupDefaultPrintService() private int print(String argFilePath, PrintService argPrintService){try { DocPrintJob printJob = argPrintService.createPrintJob();Doc doc;DocAttributeSet docAttrSet = new HashDocAttr...

java-有人可以充分利用spring-security PreAuthorize注释的优势吗?【代码】

例如:@PreAuthorize("hasRole('admin') && hasPermission('save', #user)") void updateUser(User user) {// some code }还有一些没有PreAuthorize的示例实现.void updateUser(User user) {Security.hasRole(Roles.ADMIN);Security.hasPermission(Permission.SAVE, user);// some code }第二个例子更容易理解.可以通过IDE进行重构(重命名角色,或查找所有角色用法).编译时进行代码检查.工作更快.并可能有其他优势. 为什么春季安全开...

java-Spring Security i18n:解决了错误的错误消息【代码】

我正在使用Spring(MVC),Hibernate,Spring Security和ZK作为前端的Web应用程序上工作.我正在使用所有库的最新版本(3.1.2 Spring,3.1.3 Spring Security,4.1.7 Hibernate),我对国际化有疑问(i18n).配置后,我将详细介绍(仅有关部分): web.xml:<context-param><param-name>contextConfigLocation</param-name><param-value>/WEB-INF/spring/root-context.xml /WEB-INF/spring/spring-security.xml</param-value> </context-param><li...

java-使用Spring Security 3.1.3记住我-不建议使用的默认构造函数【代码】

我正在使用Spring Security 3.1登录,但收到警告已弃用并且无法擦除,看来此配置适用于3.0版<?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/security"xmlns:beans="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schem...

java-Spring Security从同一个IP地址进行多次登录

我的问候. 我有一个问题. Spring Security中有什么方法可以检查来自同一IP地址的登录数量?我的意思是,如果有人使用此当前IP登录,我想通知他,他不能使用其他凭据(例如,使用其他浏览器)登录,并拒绝登录尝试. 我试图用Google搜索它,发现了以下内容,但这不是我想要的东西: IP filter using Spring Security Authenticating By IP Address In Spring 3.1: Smartest Way To Do That?解决方法:一种可能的解决方案是实现一对自定义Authen...

java-不调用Spring Security j_spring_security_check【代码】

我有一个使用自定义用户,角色,权限表自定义(读取为“天真的”)身份验证的Spring WebApp. 我现在正在迁移代码以使用Spring Security.我阅读了教程,以至于可以匿名访问我的login.jsp页面,css,js,png文件.我有一个动作属性为“ j_spring_security_check”的表格.提交表单后,浏览器会对该URL执行HTTP Post,从而导致404. 现在,我不使用RequestMapping映射j_spring_security_check.这是必需的吗?我们何时应该对此URL有一个请求映射? 在...

Spring SAML ADFS:java.security.InvalidKeyException【代码】

我的任务是实现对具有LDAP的Active Directory联合身份验证服务(SSL)的可访问性.首先,我不得不说我在ADFS和SAML中的经验非常少.我决定采用Spring Security SAML扩展来实现此功能.我从GIThub下载并安装了Spring Security项目的SAML扩展:https://github.com/spring-projects/spring-security-saml 我在官方文档中找到了http://docs.spring.io/spring-security-saml/docs/1.0.x/reference/html/请按照“ 6. IDP集成指南”中的说明进行...

Java Security Manager SocketPermission非常慢的解析,连接【代码】

这个问题让我ing了几天.对于特定网络上的站点(恰好是DDOS迁移提供程序),与其他站点相比,安全管理checkConnect调用似乎要花费非常非常长的时间. 该网络上的站点是否有任何办法可以阻止安全管理器的访问检查?有我不知道的配置吗?我要发疯了吗? 这是一个演示的测试用例…package com.test;import java.net.Socket; import java.util.ArrayList; import java.util.List;public class SSCCE {static class StatCounter {boolean secu...

java-Spring Security匿名用户已访问每个URL【代码】

我正在开发想要使用spring-security进行保护的gwt应用程序.我在数据库中有用户数据,并且UserService负责获取特定的User.我关注了这个tutorial AuthenticationProvider:public class CustomAuthenticationProvider implements AuthenticationProvider {@Autowired UserService userService;@Overridepublic Authentication authenticate(Authentication authentication) throws AuthenticationException {String username = (Strin...

java-/ j_spring_security_check HTTP错误404【代码】

似乎未添加某些过滤器.我将Spring Security 3.2.0.RELEASE与java-config一起使用.完整项目发布于GitHubSecurityConfig.java在这里:SecurityConfig.java 我尝试在以下位置设置过滤器:@Overrideprotected void configure(HttpSecurity http) throws Exception {http.csrf().disable().authorizeRequests().antMatchers("/app/**").hasRole("ADMIN").and().formLogin().loginPage("/").defaultSuccessUrl("/app/").failureUrl("/?er...

java-将Spring Security与SiteMinder集成【代码】

您如何将Spring Security与SiteMinder集成在一起以接收用户和角色? 我有一个使用Spring Security’in-memory’的项目设置,我想用转换它来接受带有用户和角色的SiteMinder标头. SiteMinder是否将发送用户角色(ROLE_READ,ROLE_WRITE)并让服务层授予访问权限.您如何将内存转换为使用SiteMinder? 内存中用户角色 内存中的用户和角色列表<authentication-manager><authentication-provider><user-service><user name="test" password=...

InvalidKeyException java.security.InvalidKeyException:没有安装的提供程序支持此密钥:(空)【代码】

我有两个类,一个是主类,另一个是AES的实现. 但是,在我的AES类中,我有一种解密字符串的方法,但是每当我运行它时,它都会产生异常 我的加密方法工作正常,但我的解密方法无法正常工作. 编码private Cipher aesCipherForDecryption; String strDecryptedText = new String();public String decryptAES(final String ciphertext) {try {aesCipherForDecryption = Cipher.getInstance("AES/CBC/PKCS5PADDING");aesCipherForDecryption.ini...

java-在Spring Security中禁用浏览器身份验证对话框【代码】

我正在使用Spring Security 4,出于某种原因,在完成登录页面的身份验证后,我得到浏览器身份验证对话框,该对话框迫使我再次进行身份验证. 这是我的安全配置:http.antMatcher("/test").httpBasic().and().authorizeRequests().antMatchers("/index.html", "/login.html", "/", "/scripts/**","/bower_components/**", "/styles/**", "/views/**","/login", "/api/user/*").permitAll().anyRequest().authenticated().and().logout()....

Java-Spring Security:登录后如何重定向到REST URL【代码】

我不确定我是否对主题足够了解,可以正确地提出问题. 无论如何,登录后,我想使用URL路径中的用户名重定向到URL.我该怎么做? 例如,某人使用用户名“ bmarkham”登录.登录后我想重定向到www.website.com/bmarkham 这是我的spring-security.xml<form-login login-page="/login" default-target-url="/welcome/"authentication-failure-url="/login?error" username-parameter="username"password-parameter="password" login-processin...

引起原因:java.security.NoSuchProviderException:没有这样的提供者:Crypto-Android N【代码】

这个问题已经在这里有了答案: > SecureRandom provider “Crypto” unavailable in Android N for deterministially generating a key 3个似乎“加密”提供程序已在Android N中删除. 由于NoSuchProviderException,我的应用程序崩溃了. 如果我更改了提供程序和算法,那么它将影响当前正在使用该应用程序的用户.有人有主意吗?KeyGenerator kGen = KeyGenerator.getInstan...