715 Commits

Author SHA1 Message Date
Rob Winch
d4c48dd3e1 Remove MockitoJUnitRunner from JSON tests
Previously the JSON tests unnecessarily had MockitoJUnitRunner.

This commit removes MockitoJUnitRunner from the JSON tests.

Issue gh-3736
2016-09-02 11:37:20 -05:00
Rob Winch
3fb77f3b59 Polish SecurityJacksonModules
Issue gh-3736
* ClassLoader argument - this is required because we do not want to assume
the ClassLoader that should be used
* Clean up logging - logging is now at debug level because we don't expect
all of the modules are loaded (they are quite possibly off the ClassPath)
* Remove ObjectUtils as it was being used on methods that expect a
Collection or Array with non collection based objects
* Polish Javadoc warnings
2016-09-02 11:37:13 -05:00
Rob Winch
6f2b24a62b Polish JSON warnings / javadoc
Issue gh-3736
2016-09-02 11:36:23 -05:00
Jitendra Singh Bisht
d77ca17e95 Add JSON Serialization
Fixes gh-3812
2016-09-02 11:29:53 -05:00
Rob Winch
3befb1c8a6 MvcRequestMatcher servletPath / JavaConfig
Issue: gh-3987
2016-08-09 16:29:30 -05:00
Marten Deinum
80ff267749 Check RememberMe in ExceptionTranslationFilter
This commit adds a check for rememberme to the ExceptionTranslationFilter.
Using this when someone isn't fully authenticated he will be prompted with a
login screen and after that will be redirected to the original requested URI.

Fixes gh-2427
2016-07-13 16:58:00 -04:00
Rob Winch
70787fc548 Polish CompositeLogoutHandler
Issue gh-3895
2016-07-08 14:39:35 -05:00
Eddú Meléndez
1effc1882a Add CompositeLogoutHandler
Fixes gh-3895
2016-07-08 13:30:38 -05:00
Eddú Meléndez
26fa4a4bf0 Prevent HTTP response splitting
Evaluate if http header value contains CR/LF.

Reference: https://www.owasp.org/index.php/HTTP_Response_Splitting

Fixes gh-3910
2016-07-07 13:42:52 -05:00
Eddú Meléndez
13b0ddb7e6 Fix test assertions 2016-07-07 13:29:00 -05:00
Rob Winch
9d50944cb2 AntPathRequestMatcher implements RequestVariableExtractor
Issue gh-3964
2016-07-06 15:47:34 -05:00
Rob Winch
e4c13e3c0e Add MvcRequestMatcher
Fixes gh-3964
2016-07-06 15:47:23 -05:00
Rob Winch
2a73f3cdf7 Remove abigious import 2016-06-20 15:03:09 -05:00
Eddú Meléndez
a2ead4cf7a Polish
Fixes gh-3892
2016-06-20 12:35:43 -05:00
Ruben Dijkstra
364db6762e Add failing test for #3905 Fix Assert usage 2016-06-20 09:24:04 -05:00
Adrien SAUVEZ
c261975be0 Set cookie domain for cancel remember-me
Fixes gh-3871
2016-05-13 13:34:43 -05:00
Rob Winch
d4218c70f1 Update CookieCsrfTokenRepository docs to cookiHttpOnly=false
Currently CookieCsrfTokenRepository does not specify that the httpOnly
flag needs set to false. We should update the reference to include this
setting (and a comment about it) since it states that the settings will
work with AngularJS.

This commit updates the documentation and provides a convenience factory
method to create a CookieCsrfTokenRepository with cookiHttpOnly=false

Fixes gh-3865
2016-05-06 16:28:04 -04:00
Rob Winch
9745de9510 Add @AuthenticationPrincipal expression
It is now possible to provide a SpEL expression for
@AuthenticationPrincipal. This allows invoking custom logic including
methods on the principal object.

Fixes gh-3859
2016-05-03 18:08:52 -04:00
Joe Grandja
2bdb0231c2 CookieCsrfTokenRepository supports HttpOnly
CookieCsrfTokenRepository supports HttpOnly

Fixes gh-3835

* Add Servlet 3 tests and javadocs

Issue gh-3835

* Add copyright header

Issue gh-3835
2016-05-02 15:49:37 -05:00
Rob Winch
7fe0a135ec Default AntPathRequestMatcher to be case sensitive
Issue gh-3831
2016-04-20 13:29:18 -05:00
Rob Winch
6fa1588de9 Disable AntPathRequestMatcher trim tokens
Issue gh-3831
2016-04-20 13:29:17 -05:00
Rob Winch
4093690322 Polish Logout Content Negotiation
* Rename to DelegatingLogoutSuccessHandler for consistency
* Remove JavascriptOriginRequestMatcher in favor of
RequestHeaderRequestMatcher

Issue gh-3282
2016-04-20 10:49:37 -05:00
Shazin Sadakath
f0d1700ad6 Content Negotiating LogoutSuccessHandler
Issue gh-3282
2016-04-20 10:42:13 -05:00
Rob Winch
1dbd3f5906 Fix NPE in OnCommittedResponseWrapper trackContentLength (#3824)
OnCommittedResponseWrapper trackContentLength will throw a
NullPointerException when the content length passed in is null.

This commit properly tracks the null value as a length of 4.

Fixes gh-3823
2016-04-19 14:58:56 -04:00
Rob Winch
fb5776cb5c Support Camel case URI variables (#3814)
Perviously there were issues with case insenstive patterns and URI
variables that contained upper case characters. For example, the pattern
"/user/{userId}" could not resolve the variable #userId Instead it was
forced to lowercase and #userid was used.

Now if the pattern is case insensitive then so is the variable. This means
that #userId will work as will #userid.

Fixes gh-3786
2016-04-18 17:54:48 -04:00
Rob Winch
d3a9cc6eae Add CsrfTokenRepository (#3805)
* Create LazyCsrfTokenRepository

Fixes gh-3790

* Add CookieCsrfTokenRepository

Fixes gh-3009
2016-04-12 17:26:53 -04:00
Johnny Lim
fe94d654ed Fix typos (#228) 2016-04-12 11:11:51 -05:00
izeye
2c85fb05d0 Remove duplicate test.
Remove duplicate test with `trailingWildcardWithVariableMatchesCorrectly()`.

Fixes gh-183
2016-04-08 13:36:45 -05:00
Rob Winch
f49cd5faba Polish Codestyle 2016-04-01 09:53:32 -05:00
Rob Winch
d900c78f11 Perform null check on super.getAsyncContext()
Fixes gh-3780
2016-04-01 09:53:32 -05:00
Shazin Sadakath
1bc7060c93 Add AuthenticationSuccessHandler support to AbstractPreAuthenticatedProcessingFilter
Fixes gh-3389
2016-03-25 09:46:16 -05:00
Joe Grandja
2f7f2ff589 Adds support for Content Security Policy
Fixes gh-2342
2016-03-22 21:59:13 -05:00
Rob Winch
7bf014f678 Path Variables fail with different case
Fixes gh-3329
2016-03-21 10:09:50 -05:00
Eddú Meléndez
41c6a797c3 Add RememberMeConfigurer set domain
Fixes gh-3408
2016-03-17 08:30:18 -05:00
Rob Winch
242b831f20 Cache Control only written if not set
Previously Spring Security always wrote cache control headers and relied
on the application to override the values. This can cause problems with
cache control. For example, applications may only set cache control if
the header is not already set. Additionally, setting of Cache-Control
should disable writing of Pragma.

This commit delays writing headers until just before the response is
committed and only writes the Cache Control headers if they do not exist.

Fixes gh-2953
2016-03-15 12:30:37 -05:00
Rob Winch
1fcc2fcd88 Make OnCommittedResponseWrapper public
This is preparing for changes in gh-2953

Issues gh-2953
2016-03-15 11:22:06 -05:00
Rob Winch
f221920a19 Clean up code to conform to basic checkstyle
Issue gh-3746
2016-03-14 00:15:12 -05:00
Billy Korando
71d4ce96ad Convert to assertj
Fixes gh-3175
2016-03-09 14:30:17 -06:00
Rob Winch
bb600a473e Start AssertJ Migration
Issue gh-3175
2016-03-09 14:26:30 -06:00
Rob Winch
6cbb1dc881 Polish ForwardAuthenticationSuccessHandler
* Whitespace cleanup
* Add @since

Issue gh-3726
2016-03-09 10:23:53 -06:00
Rob Winch
e61bc7e93b Polish ForwardAuthenticationFailureHandler
* Whitespace cleanup
* Add @since

Issue gh-3727
2016-03-09 10:23:39 -06:00
Shazin Sadakath
7341da9320 Add ForwardAuthenticationSuccessHandler
Fixes gh-3726
2016-03-09 10:22:55 -06:00
Shazin Sadakath
b288d24100 Add ForwardAuthenticationFailureHandler
Fixes gh-3727
2016-03-09 10:22:41 -06:00
Tim Ysewyn
331c7e91b7 HTTP Public Key Pinning
HTTP Public Key Pinning (HPKP) is a security mechanism which allows HTTPS websites
to resist impersonation by attackers using mis-issued or otherwise fraudulent certificates.
(For example, sometimes attackers can compromise certificate authorities,
 and then can mis-issue certificates for a web origin.)
The HTTPS web server serves a list of public key hashes, and on subsequent connections
clients expect that server to use 1 or more of those public keys in its certificate chain.

This commit will add this new functionality.

Fixes gh-3706
2016-03-03 14:21:46 -06:00
Andrei Ivanov
9008a7af1d Allow override of SwitchUserFilter.ROLE_PREVIOUS_ADMINISTRATOR
Fixes gh-3697
2016-02-15 09:03:27 -06:00
Rob Winch
56fad169db request.setMethod("POST") 2015-12-21 14:53:13 -06:00
Rob Winch
4144de9376 SEC-3082: make SavedRequest parameters case sensitive 2015-10-29 16:46:11 -05:00
Rob Winch
8b641e5f79 SEC-2190: Support WebApplicationContext in ServletContext attribute 2015-10-28 15:12:35 -05:00
Rob Winch
5c73816a1a SEC-3108: DigestAuthenticationFilter should use SecurityContextHolder.createEmptyContext() 2015-10-27 13:56:51 -05:00
Rob Winch
a88ac0fcc1 SEC-3109: Fix web tests 2015-10-26 21:31:07 -05:00