988 Commits

Author SHA1 Message Date
Craig Andrews
ab34c0308c
Add guard around logger.debug statement
The log message involves string concatenation, the cost of which
should only be incurred if debug logging is enabled

Issue gh-9648
2021-04-16 10:57:53 -06:00
佚名
8dc702c80f
Add null check in CsrfFilter and CsrfWebFilter
Solve the problem that CsrfFilter and CsrfWebFilter
throws NPE exception when comparing two byte array
is equal in low JDK version.

When JDK version is lower than 1.8.0_45, method
java.security.MessageDigest#isEqual does not verify
whether the two arrays are null. And the above two
class call this method without null judgment.

ZiQiang Zhao<1694392889@qq.com>

Closes gh-9561
2021-04-09 21:57:14 -06:00
Rob Winch
e2121532a2
Optimize HttpSessionSecurityContextRepository
Closes gh-9387
2021-02-11 09:38:04 -07:00
Rob Winch
7cab7b06c5
Optimize HttpSessionSecurityContextRepository
Closes gh-9387
2021-02-11 09:38:04 -07:00
Josh Cummings
68ac3ef36b
Polish Tests
Issue gh-9331
2021-02-03 09:34:20 -07:00
happier233
7a5c34ca57
Configure CurrentSecurityContextArgumentResolver BeanResolver
Closes gh-9331
2021-02-03 09:34:13 -07:00
Rob Winch
1181740f79 Constant Time Comparison for CSRF tokens
Closes gh-9291
2021-01-20 16:18:25 -06:00
Rob Winch
628ea00ad4 Fix CsrfWebFilter error message when expected CSRF not found
Closes gh-9337
2021-01-12 11:31:26 -06:00
Tomoki Tsubaki
85889d5e0b
Create the CSRF token on the bounded elactic scheduler
The CSRF token is generated by UUID.randomUUID() which is I/O blocking operation.
This commit changes the subscriber thread to the bounded elactic scheduler.

Closes gh-9018
2020-09-16 09:21:11 -06:00
Rob Winch
dcd2137418 LoginPageGeneratingWebFilter honors context path
Closes gh-8807
2020-07-07 13:37:06 -05:00
Joe Grandja
674e2c0a8e OAuth2LoginAuthenticationWebFilter should handle OAuth2AuthorizationException
Issue gh-8609
2020-06-09 16:24:00 -04:00
Eleftheria Stein
a6dd119266 Mock request with non-standard HTTP method in test
Fixes gh-8594
2020-05-26 11:32:27 -04:00
cbornet
21c1d98f64 Create the CSRF token on the bounded elactic scheduler
The CSRF token is created with a call to UUID.randomUUID which is blocking.
This change ensures this blocking call is done on the bounded elastic scheduler which supports blocking calls.

Fixes gh-8128
2020-05-18 11:06:45 -05:00
Artyom Tarynin
9f33ce312a Update AntPathRequestMatcher.java
Fixes gh-8512
2020-05-14 10:05:52 -04:00
Rob Winch
bd93616567 Fix non-standard HTTP method for CsrfWebFilter
Closes gh-8452
2020-05-12 13:18:01 -05:00
Rob Winch
52ed597f4c Fix example in javadoc of FilterChainProxy
Closes gh-8344
2020-04-08 09:14:02 -05:00
Rob Winch
615f9a3f05 Fix HttpServlet3RequestFactory Logout Handlers
Previously there was a problem with Servlet API logout integration
when Servlet API was configured before log out.

This ensures that logout handlers is a reference to the logout handlers
vs copying the logout handlers. This ensures that the ordering does not
matter.

Closes gh-4760
2020-03-30 20:51:25 -05:00
Josh Cummings
258627eaee
SwitchUserFilter Defaults to POST
Fixes gh-4183
2020-03-27 14:40:38 -06:00
Zeeshan Adnan
a49a325db2 Fix exception for empty basic auth header token
fixes spring-projectsgh-7976
2020-03-16 16:06:52 -04:00
AmitB
96ff3a54a9 Fix typo in AntPathRequestMatcher contructor comment 2020-03-02 07:16:07 -06:00
Peter Keller
2dbedf7af5 Set charset of BasicAuthenticationFilter converter
Allow BasicAuthenticationFilter to pick up the given credentials charset.

Fixes: gh-7835
2020-01-23 16:24:03 +01:00
Rob Winch
29182abb34 Fix HttpHeaderWriterWebFilterTests
Ensure setComplete() is subscribed to
2020-01-10 08:46:47 -06:00
Rob Winch
29eb8b9177 CompositeServerHttpHeadersWriter Executes Sequentially
Fixes gh-7731
2019-12-12 11:28:23 -06:00
Rob Winch
bd6ff1f319 DelegatingServerAuthenticationSuccessHandler Executes Sequentially
Fixes gh-7728
2019-12-12 08:33:14 -06:00
Rob Winch
6db7b457b7 DelegatingServerLogoutHandler Executes Sequentially
Fixes gh-7723
2019-12-11 15:39:56 -06:00
Joe Grandja
752d5f29aa Display general error message when WebFlux oauth2Login() fails
Issue gh-5562 gh-6484
2019-12-05 20:12:38 -05:00
Josh Cummings
5f17032ffd Restore Removed Throws Clauses
In a recent clean-up, certain exceptions were removed from various
throws clauses.

This PR re-introduces throws clauses that are important for one of the
following reasons:

1. It's a method on a public interface
2. It's a method clearly designed for inheritance, for example, a
method stub, an abstract method, or indicated as such in the docs.

Fixes gh-7541
2019-10-30 12:13:54 -06:00
Rob Winch
635f7e1edd CsrfWebFilter supports multipart/form-data
Fixes gh-7576
2019-10-28 14:06:10 -05:00
Filip Hrisafov
b9f122230b Align javadoc of continueFilterChainOnUnsuccessfulAuthentication with actual behaviour 2019-10-23 14:50:57 -04:00
Michel Palourdio
d26f40f062 DefaultRedirectStrategy should redirect to root if the context-relative URL does not contain the context-path. 2019-10-23 09:41:00 -04:00
Tadaya Tsuyukubo
62c7de03c3 Add RequestMatcher to AbstractPreAuthenticatedProcessingFilter
Moved the existing auth check logic to the matcher.

Issue: gh-5928
2019-10-22 16:55:54 -04:00
Eleftheria Stein
264daec697 Test context relative URL with multiple schemes 2019-10-16 15:32:02 -04:00
Josh Cummings
b764af6b9b
CookieServerCsrfTokenRepositoryTests Leading Dot
ResponseCookie removed support for having a leading dot in the cookie
domain.

Fixes gh-7500
2019-09-30 08:39:45 -06:00
Josh Cummings
7949dd492a
Move DelegatingServerAuthenticationSuccessHandlerTests
Moved from src/test/groovy to src/test/java

Issue gh-5332
2019-09-27 16:57:43 -06:00
Josh Cummings
5f905232cb
Polish CurrentSecurityContextArgumentResolvers
Fixes gh-7487
2019-09-27 13:19:08 -06:00
Rob Winch
00f8991fac Merge Remove Redudant Throws
Fixes gh-7301
2019-09-19 11:04:53 -05:00
Onur Kagan Ozcan
034b5e9e93 Introduce LogoutSuccessEvent
LogoutSuccessEvent is a simple AbstractAuthenticationEvent implementation which indicates successful logout.

By default, LogoutConfigurer will add a new LogoutHandler called LogoutSuccessEventPublishingLogoutHandler to publish this event.

This PR will also fix ConcurrentSessionFilter's composite logoutHandler, now will get LogoutHandler instances from LogoutConfigurer for consistency.

Fixes gh-2900
2019-09-18 10:57:16 -05:00
Josh Cummings
7576dc44d7
AuthenticationFilter Session Fixation Protection
Fixes gh-7446
2019-09-17 08:17:09 -06:00
Josh Cummings
496a2cdc60
Make AuthenticationFilter methods private
Fixes gh-7447
2019-09-17 08:06:21 -06:00
Josh Cummings
aa12748c9b Add Request-level CSRF Skip
Fixes gh-7367
2019-09-13 19:04:05 +01:00
Eleftheria Stein
9f0986a093 Fix javadoc typo for invalid session strategy 2019-09-09 16:51:14 -04:00
Filip Hanik
08d50868c9
Merge pull request #7260 from fhanik/feature/saml2-sp-mvp
Add SAML Service Provider Support
2019-09-05 17:04:14 -07:00
Filip Hanik
e9a44bc0ce HttpSecurity.saml2login() - MVP Core Code
Implements minimal SAML 2.0 login/authentication functionality with the
following feature set:

  - Supports IDP initiated login at the default url of /login/saml2/sso/{registrationId}
  - Supports SP initiated login at the default url of /saml2/authenticate/{registrationId}
  - Supports basic java-configuration via DSL
  - Provides an integration sample using Spring Boot

Not implemented with this MVP

  - Single Logout
  - Dynamic Service Provider Metadata

Fixes gh-6019
2019-09-05 14:40:08 -07:00
Rob Winch
2a1f3f6aa7 Remove Package Tangle in HeaderWriterFilter
Fixes gh-7380
2019-09-05 16:08:45 -05:00
Josh Cummings
39e84013f7
ClearSiteDataHeaderWriter Directives
Fixes gh-7347
2019-09-03 15:57:10 -06:00
Eleftheria Stein
ad0d3e9702 Polish remember me username check 2019-09-03 11:48:46 -04:00
Scott Murphy
26ae590c68 Check that userdetails for username exists. #7251 2019-09-03 11:48:46 -04:00
kostya05983
f6c650db47
Replace Streams with Loops
First version of replacing streams

fix wwwAuthenticate and codestyle

fix errors in implementation to pass tests

Fix review notes

Remove uneccessary final to align with cb

Short circuit way to authorize

Simplify error message, make code readably

Return error while duplicate key found

Delete check for duplicate, checkstyle issues

Return duplicate error

Fixes gh-7154
2019-09-02 15:30:48 -06:00
Lars Grefer
95511331fa fix checkstyle 2019-08-26 22:42:26 +02:00
watsta
2c2e8e5f24 Remove internal Optional usage in favor of null checks
Issue gh-7155
2019-08-26 09:27:40 -04:00