spring-security

Modify Spring Security Config at Runtime

岁酱吖の 提交于 2020-04-14 07:33:09
问题 I am using the latest Spring Boot + Spring Boot Starter Security for a simple proxy application. The goal is to launch the application with a single route/method: @RequestMapping(value = "/api/register", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<?> register(Registration registration) { With a security configuration of: @Override protected void configure(HttpSecurity http) throws Exception { this.http = http .authorizeRequests()

Modify Spring Security Config at Runtime

|▌冷眼眸甩不掉的悲伤 提交于 2020-04-14 07:32:10
问题 I am using the latest Spring Boot + Spring Boot Starter Security for a simple proxy application. The goal is to launch the application with a single route/method: @RequestMapping(value = "/api/register", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE) @Timed public ResponseEntity<?> register(Registration registration) { With a security configuration of: @Override protected void configure(HttpSecurity http) throws Exception { this.http = http .authorizeRequests()

Spring-Security PasswordEncoder returns null

蓝咒 提交于 2020-04-11 16:26:11
问题 I have implemented Spring security on my struts2 application and it perfectly works, but it runs into error java.lang.NullPointerException on line 3. Although it seems passwordEncoder configuration works as by adding those I cant login with a plain text password any more. <authentication-manager> <authentication-provider> <password-encoder ref="passwordEncoder"/> <jdbc-user-service data-source-ref="dataSource" users-by-username-query=" select username,password,enabled from Users where

Spring boot 1.5.9, 404 error while accessing resources images within Docker container

痞子三分冷 提交于 2020-04-11 06:50:05
问题 The bounty expires in 3 days . Answers to this question are eligible for a +100 reputation bounty. Dimitri Kopriwa is looking for an answer from a reputable source : I am still experiencing this and I am willing to help and add further information to understand and solve this issue. Currently, I am moving forward with a NodeJS fallback solution which will expose publicly those images. In a Spring Boot 1.5.9 application I want to access static resources through HTTP using Google Chrome. In

Spring boot 1.5.9, 404 error while accessing resources images within Docker container

你说的曾经没有我的故事 提交于 2020-04-11 06:46:08
问题 The bounty expires in 3 days . Answers to this question are eligible for a +100 reputation bounty. Dimitri Kopriwa is looking for an answer from a reputable source : I am still experiencing this and I am willing to help and add further information to understand and solve this issue. Currently, I am moving forward with a NodeJS fallback solution which will expose publicly those images. In a Spring Boot 1.5.9 application I want to access static resources through HTTP using Google Chrome. In

Spring Security CORS filter not working

﹥>﹥吖頭↗ 提交于 2020-04-11 00:02:10
问题 I'm using spring security with OAuth2 (version: 4.0.4.RELEASE) and spring (verison: 4.3.1.RELEASE). I'm developing frontend in Angular and I'm using grunt connect:dev (http://127.0.0.1:9000). When I trying to login by localhost address everything working fine but from other I'm getting error: "XMLHttpRequest cannot load http://localhost:8084/oauth/token?client_id=MY_CLIENT_ID. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present

Spring Security CORS filter not working

浪子不回头ぞ 提交于 2020-04-11 00:01:07
问题 I'm using spring security with OAuth2 (version: 4.0.4.RELEASE) and spring (verison: 4.3.1.RELEASE). I'm developing frontend in Angular and I'm using grunt connect:dev (http://127.0.0.1:9000). When I trying to login by localhost address everything working fine but from other I'm getting error: "XMLHttpRequest cannot load http://localhost:8084/oauth/token?client_id=MY_CLIENT_ID. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present

Spring security redirects to page with status code 999

喜你入骨 提交于 2020-04-07 10:34:26
问题 After successful login spring redirects to /error page with the following content { "timestamp" : 1586002411175, "status" : 999, "error" : "None", "message" : "No message available" } I'm using spring-boot 2.2.4 My config: spring.mvc.view.prefix=/WEB-INF/views/ spring.mvc.view.suffix=.jsp spring.mvc.servlet.load-on-startup=1 spring.mvc.throw-exception-if-no-handler-found=true spring.resources.add-mappings=false @Configuration public class DispatcherContextConfig implements WebMvcConfigurer {

Spring security redirects to page with status code 999

只愿长相守 提交于 2020-04-07 10:30:10
问题 After successful login spring redirects to /error page with the following content { "timestamp" : 1586002411175, "status" : 999, "error" : "None", "message" : "No message available" } I'm using spring-boot 2.2.4 My config: spring.mvc.view.prefix=/WEB-INF/views/ spring.mvc.view.suffix=.jsp spring.mvc.servlet.load-on-startup=1 spring.mvc.throw-exception-if-no-handler-found=true spring.resources.add-mappings=false @Configuration public class DispatcherContextConfig implements WebMvcConfigurer {

Spring security redirects to page with status code 999

邮差的信 提交于 2020-04-07 10:29:53
问题 After successful login spring redirects to /error page with the following content { "timestamp" : 1586002411175, "status" : 999, "error" : "None", "message" : "No message available" } I'm using spring-boot 2.2.4 My config: spring.mvc.view.prefix=/WEB-INF/views/ spring.mvc.view.suffix=.jsp spring.mvc.servlet.load-on-startup=1 spring.mvc.throw-exception-if-no-handler-found=true spring.resources.add-mappings=false @Configuration public class DispatcherContextConfig implements WebMvcConfigurer {