Commit Graph

30 Commits

Author SHA1 Message Date
N. Taylor Mullen 9c9543dde4 Rename AspNet 5 file contents.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:24:22 -08:00
N. Taylor Mullen bc0d5528a3 Rename AspNet 5 folders and files.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:24:19 -08:00
John Luo 115e89d6f8 Reacting to hosting rename 2016-01-17 17:08:20 -08:00
Victor Hurdugaci 9e032102f6 Build with dotnet 2016-01-15 15:53:26 -08:00
Ajay Bhargav Baaskaran 80fa2908bd Throwing custom AntiforgeryException for token validation failure scenarios 2016-01-07 15:12:55 -08:00
ryanbrandenburg a281b2e369 * Add functional tests for sample 2016-01-06 09:37:15 -08:00
Hao Kung 0eec60b0ac React to OptionsModel => Options 2015-12-21 14:54:54 -08:00
Ryan Nowak 3280ff6ac5 Add Header support
This change adds support for retrieving an antiforgery CSRF token via a
configurable header in addition to the form field. This helps with doing
ajax requests in a 1st-party SPA when using cookie auth, and is similar to
functionality provided by a bunch of different frameworks.

In this change there's also a bunch of churn due to avoiding the term
'form' in favor of 'request' and 'session' in favor of 'cookie'. Where
code and error message now mention 'form' they specifically mean
form-encoded content.
2015-12-15 14:18:09 -08:00
Pranav K 463e8f9473 React to HtmlAbstractions namespace rename 2015-12-02 10:30:01 -08:00
Doug Bunting 6a9b38db77 Return an `IHtmlContent` from `IAntiforgery.GetHtml()`
- part of aspnet/Mvc#3123
- no longer forces caller to wrap the return value in an `HtmlString`

nit: don't HTML encode the word "hidden"
2015-11-25 09:44:54 -08:00
Pranav K 130e8f0398 Updating tests to use moq.netcore 2015-11-23 11:39:40 -08:00
Hao Kung e2632d47f0 React to DataProtection changes 2015-11-17 14:08:22 -08:00
Pranav K 1c39930b16 Reacting to DependencyInjection changes 2015-11-13 10:33:23 -08:00
ryanbrandenburg c82ac5e61f * Return old cookie token 2015-11-12 11:52:39 -08:00
Cesar Blum Silveira ff3c8023a0 Merge branch 'release' into dev 2015-11-03 13:34:38 -08:00
Cesar Blum Silveira 391086e3ce Strong name Microsoft.AspNet.Antiforgery. 2015-11-03 12:51:41 -08:00
Chris R 7edbabd498 React to Http.Abstractions changes. 2015-11-03 10:15:23 -08:00
Chris R 84cfe5640d React to WebEncoders changes. 2015-10-30 11:45:48 -07:00
Pranav K 7a0068ede2 Renaming Microsoft.Framework.* -> Microsoft.Extensions.* 2015-10-03 15:44:46 -07:00
Pranav K e0ec2da711 Replacing NotNull with thrown exceptions 2015-09-11 17:07:52 -07:00
Hao Kung 83ea8051c8 Update test 2015-09-02 15:44:39 -07:00
Hao Kung f5c8bf09e2 React to options 2015-09-02 15:28:52 -07:00
Chris R 7bb59a287c React to string[] -> StringValues changes. 2015-08-28 14:23:17 -07:00
unknown b922d816be Fix aspnet/Mvc#2749 - fail gracefully with non-form content
This change will report a more specific error when antiforgery is used
with non-form content than "invalid content type".
2015-08-06 10:29:16 -07:00
Ryan Nowak 9bcecf3994 Fix #5 - better error message for missing tokens
This fix changes the model for error messaging in antiforgery. Now only
the token store will report a detailed error message including the names
of form field and cookie. Other components will give more generic errors
and assume that this was handled by the token store.

This way you still see an error if the user creates a token store that
doesn't throw, but it's a generic error that doesn't give incorrect
information.
2015-08-06 08:48:47 -07:00
Ryan Nowak e13e707503 CR feedback and naming/resource cleanup 2015-06-25 13:25:52 -07:00
Ryan Nowak b3e92da7d8 Add an IAntiforgery interface and simplify API 2015-06-24 15:56:03 -07:00
Ryan Nowak 9eeb1de68f Use DI for all Antiforgery services
This change makes it possible to replace all of the various
IAntiforgery*** extensibility points via DI.

changes:
- Move functionality out of AntiforgeryWorker into Antiforgery
- Move services to DI (instead of constructed by Antiforgery)
- Cleanup how application/cookie-name is computed
- Merge IAntiforgeryTokenGenerator & IAntiforgeryTokenValidator
- Unseal classes
- Fix use of options in services
- Misc test cleanup
2015-06-23 12:13:01 -07:00
Ryan Nowak 3dc2663c35 Code dump of Antiforgery code 2015-06-10 12:13:30 -07:00
Ryan Nowak 2c3544c348 Add project structure 2015-06-07 16:57:21 -07:00