spring-security

Spring Boot Security wont ignore certain paths that dont need to be secured

我是研究僧i 提交于 2020-07-23 06:20:31
问题 I've seen people post about this issue before. The problem is that I want everything in my /api/v1/auth/ controller to not go through the JWT filter chain. This is what my my security config looks like @Configuration @EnableWebSecurity class SecurityConfig() : WebSecurityConfigurerAdapter() { @Autowired lateinit var tokenService: TokenService override fun configure(web: WebSecurity) { web.ignoring().antMatchers( "/v2/api-docs", "/configuration/ui", "/swagger-resources/**", "/configuration

Spring Boot Security wont ignore certain paths that dont need to be secured

大城市里の小女人 提交于 2020-07-23 06:19:37
问题 I've seen people post about this issue before. The problem is that I want everything in my /api/v1/auth/ controller to not go through the JWT filter chain. This is what my my security config looks like @Configuration @EnableWebSecurity class SecurityConfig() : WebSecurityConfigurerAdapter() { @Autowired lateinit var tokenService: TokenService override fun configure(web: WebSecurity) { web.ignoring().antMatchers( "/v2/api-docs", "/configuration/ui", "/swagger-resources/**", "/configuration

How to fix HTTP parameter/path pollution attack Spring Rest

旧街凉风 提交于 2020-07-22 22:16:31
问题 Extracting parameters from HTTP message and getting resource URLs could be vulnerable to injection attacks that may change the semantics of the intended resource. Two classes of attacks are relevant here: HTTP parameter/path pollution (HPPP) and Server-Side Request Forgery (SSRF). Remember that our attacker has full control over the HTTP request or the HTTP response. In an HPPP (HTTP parameter/path pollution attack), a parameter is used to compose the resource URL to be used to prepare a REST

How to fix HTTP parameter/path pollution attack Spring Rest

丶灬走出姿态 提交于 2020-07-22 22:14:04
问题 Extracting parameters from HTTP message and getting resource URLs could be vulnerable to injection attacks that may change the semantics of the intended resource. Two classes of attacks are relevant here: HTTP parameter/path pollution (HPPP) and Server-Side Request Forgery (SSRF). Remember that our attacker has full control over the HTTP request or the HTTP response. In an HPPP (HTTP parameter/path pollution attack), a parameter is used to compose the resource URL to be used to prepare a REST

Spring Boot JDBC Authentication failing

Deadly 提交于 2020-07-22 07:22:28
问题 I'm trying to use JDBC Authentication for a REST Controller using Postgresql database. The Configuration class, which manages the authentication is the following one: @Configuration @EnableAutoConfiguration public class JDBCSecurityConfig extends WebSecurityConfigurerAdapter { @Autowired DataSource dataSource; @Autowired public void configAuthentication(AuthenticationManagerBuilder auth) throws Exception { auth.jdbcAuthentication().dataSource(dataSource) .usersByUsernameQuery("select username

Spring Security SAML: Extract Attributes from a saml2p:Response as user attributes

ぐ巨炮叔叔 提交于 2020-07-20 11:10:34
问题 I have been digging into spring security yaml a little bit yesterday to make it work with Okta SAML. Logging in works, but the response XML contains user attributes that apparently cannot be extracted automatically into an attribute map. The response contains a fields like this <saml2:Attribute Name="user.lastName" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified"> <saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema

Spring 5 Security OAuth2 Login Redirect Loop

ぃ、小莉子 提交于 2020-07-20 10:55:09
问题 I want to work with Spotify Web API, but I'm having trouble with Spring Security Configuration. Here are my security dependencies: /* springBootVersion = '2.1.2.RELEASE' */ implementation "org.springframework.security:spring-security-oauth2-client" implementation 'org.springframework.security:spring-security-oauth2-jose:5.1.6.RELEASE' implementation "org.springframework.security.oauth.boot:spring-security-oauth2-autoconfigure:2.1.7.RELEASE" And here's my security in my application.yml file:

SpringBoot - Error parsing HTTP request header (Oauth2 https endpoints)

我与影子孤独终老i 提交于 2020-07-18 22:15:12
问题 when I am trying to access OAuth HTTPS endpoints from spring boot app , i am getting below error, but HTTP endpoint works perfectly fine Error: 2018-07-24 10:25:06.292 [DEBUG][8464][https-jsse-nio-8084-exec-8] o.apache.coyote.http11.Http11Processor: Error parsing HTTP request header java.io.EOFException: null at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1250) at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.read(NioEndpoint.java:1190) at

spring security does not redirect after successful login

老子叫甜甜 提交于 2020-07-18 15:46:17
问题 i use spring security 3.2.5 for user authentication. after i provide user name and password in login page it is not redirecting to page mentioned in defaultSuccessUrl method and it just reloads login page. following is my code please let me know what is wrong in this. @Configuration @EnableWebMvcSecurity public class SecurityConfig extends WebSecurityConfigurerAdapter { @Autowired private DataSource dataSource; @Override public void configure(WebSecurity webSecurity) throws Exception{

Spring security - creating 403 Access denied custom response

折月煮酒 提交于 2020-07-17 07:51:12
问题 I have a spring boot rest api with jwt authentication. The problem is i cannot get rid of default 403 Access Denied rest response which looks like this: { "timestamp": 1516206966541, "status": 403, "error": "Forbidden", "message": "Access Denied", "path": "/api/items/2" } I created custom AccessDeniedHandler: public class CustomAccessDeniedHandler implements AccessDeniedHandler { @Override public void handle(HttpServletRequest req, HttpServletResponse res, AccessDeniedException