草庐IT

spring-security-oauth2

全部标签

java - 添加带有 spring security 的自定义登录 Controller

从springpetclinicsampleapp构建的应用程序使用自定义登录表单添加了spring安全性。该应用没有thistutorial建议的WebMvcConfiguration.java类.相反,它在mvc-core-config.xml中有以下行:我在eclipse中执行了Ctrl-H并在整个工作区中对术语/login进行了关键字搜索,但没有Controller可见。我还查看了上面教程链接中提到的messages-jc示例项目,但在那里也找不到“/login”Controller。我如何添加一个Controller,它将使用标准用户名和密码执行spring身份验证,但当“/

java - liferay spring portal @ResourceMapping 无法触发不同类型的http方法

我使用Spring、thymeleaf和AngularJS创建了一个liferayportlet应用程序。对于AngularJS和spring之间的通信,我需要创建一些我使用@ResourceMapping创建的rest调用,如下所示。该应用程序工作正常,但问题是我不知道如何制作GET、DELETE、PUThttpREST调用,因为@ResourceMapping不允许指定任何方法。@ResourceMapping(value="getUserDetail")publicvoiduserDetail(@RequestParamlonguserId,ResourceResponseres

java - Spring Boot + Thymeleaf 的@WebAppConfiguration 和@ContextConfiguration

给定一个SpringBoot+ThymeleafWeb应用程序(这与Spring项目的gs-consuming-rest"initial"codetree几乎相同):├──pom.xml└──src├──main│  ├──java│  │  └──hello│  │  ├──Application.java│  │  ├──Config.java│  │  └──Controller.java│  └──resources│  └──templates│  └──index.html└──test└──java└──hello└──ControllerTest.java...用户会收

java - 如何使用java配置在spring中配置waffle

我一直在努力使用springjava配置让waffle与spring4.2.5一起工作。我想我也可以帮助处于相同情况的其他人。我们使用自定义的preWaffle和postWaffle过滤器来验证用户在通过wafflesNTLM协议(protocol)验证后是否存在于我们的数据库中。我们还有使用EnableGlobalMethodSecurity注释对用户操作进行授权的方法。至少可以说,要在springjava配置中让它工作是很麻烦的。您可以在下面的答案中找到我们的解决方案。希望对您有所帮助。 最佳答案 SpringConfigura

java - Spring RestTemplate 遵循带有 cookie 的重定向

最近我遇到了一个问题,我需要对远程服务执行一个GET请求(我想是使用一个简单的servlet),而RestTemplate返回了重定向太多!.经过一些调查,似乎对指定远程服务的第一个请求实际上只是一个带有一些Set-Cookieheader的302重定向(到自身)。如果我使用的是“普通”浏览器,它会确认header,正确设置cookie,并在应该满足正常200响应的地方遵循重定向。我发现RestTemplate不接受Set-Cookieheader,因此会一遍又一遍地进行重定向。有没有办法让RestTemplate仅针对当前请求确认Set-Cookieheader?我最好不希望它保持状

How to Resolve SSL Security Error- [DBNETLIB][ConnectionOpen(SECDoClientHandshake()).]

duringmy deplodeploymentHWSinDeltaVsystem,afterthatoriginallySQLconnectionwasfailedtoconnectsuchasXLReport.forinvesinvestigatewefounddetail   messageisaboutTLS1.0andTLS2.0compacompatibilityissue.so,Ianticipatethatthisarticle,wouldhelpasmanypeopleaspossible. AFewwordsAboutTLS1.0 TSL1.0isconsideredade

java - multipart和@RequestBody在spring可以一起用吗?

我想创建一个API,它可以将参数作为多部分文件和JSON对象(@RequestBody)。请在调用此API时找到以下代码段。我得到HTTP415UnsupportedMediaTypeerror.如果我删除@RequestBodyLabPatientInforeportData然后它工作正常。@RequestMapping(value={"/lab/saveReport"},method={RequestMethod.POST},consumes={"multipart/form-data"},headers={"Accept=application/json"})@ResponseB

java - Spring 安全 : hasAuthority is ignored when configured globally for HttpSecurity

我在带有OAuth2的SpringMVC上有一个RESTAPI。为了支持像hasRole和hasAuthority这样的表达式处理程序,我添加了以下配置:@Configuration@EnableGlobalMethodSecurity(prePostEnabled=true)publicclassMethodSecurityConfigextendsGlobalMethodSecurityConfiguration{@OverrideprotectedMethodSecurityExpressionHandlercreateExpressionHandler(){returnnewO

java - 错误无法注册 mbean java.security.AccessControlException : access denied ("javax.management.MBeanTrustPermission" "register")

例如启动Elasticsearch5.5时:主要错误无法注册mbeanjava.security.AccessControlException:访问被拒绝(“javax.management.MBeanTrustPermission”“register”) 最佳答案 OracleJava1.8.0_131的解决方法是打开文件/lib/security/java.policy并将此行添加到grant部分(即大括号之间):permissionjavax.management.MBeanTrustPermission"register";

java - Spring-Boot:并发处理多个请求

我正在使用SpringBoottobuildaRESTfulwebservice.我的IDE是EclipseOxygen。我通过Chrome每2秒发送多个HTTP获取请求,但它们被一个接一个地触发。每个请求都将等待前一个请求完成。这是我的Controller代码:@RestController@RequestMapping("/dummy")publicclassDummyController{@RequestMapping(method=RequestMethod.GET)publicResponseEntity>dummytsp(@RequestParam(value="msg",