aspnetcore/test/Microsoft.AspNetCore.Authen...
Patrick Westerhoff 06c93669d6 Allow overwriting parameters on challenge requests
Add a way to overwrite query arguments that are passed as part of the
challenge request to the external authentication provider in OAuth-based
authentication providers, including OpenID Connect.

This uses the new `AuthenticationProperties.Parameters` collection to
pass parameters to the authentication handler which will then look for
special items within that property bag, overwriting previously
configured values within the authentication options.

This can be used for example to overwrite the OAuth scopes that are
requested from an authentication provider, or to explicitly trigger a
reauthentication by requiring a login prompt with OpenID Connect. By
being able to specify this on individual challenge requests (using
`HttpContext.ChallengeAsync`), this is independent from the global
scheme configuration.

Custom ~ChallengeProperties types, e.g. `OAuthChallengeProperties` for
OAuth-based authentication providers, provide assistance in setting the
challenge request parameters but are not required to make the handlers
use the overwritten values.

- Adjust authentication handlers to respect the custom parameters, and
  add ~ChallengeProperties types.
- Introduce `OAuthHandler.FormatScope(IEnumerable<string>)` to format a
  custom set of scopes. Subclasses requiring a different scope format
  should override this method instead of the parameterless overload.
  Overriding just `FormatScope()` will prevent handlers from supporting
  overwriting the OAuth `scope` in a challenge request.
- Refactor GoogleHandler to support parameterization through both the
  `Parameters` and the `Items` collection (former is preferred) to keep
  compatibility with the old behavior.
- Add an OpenIdConnect sample to overwrite the prompt argument in a
  challenge request.
- Add extensive tests.
2018-03-23 02:09:05 +01:00
..
OpenIdConnect Allow overwriting parameters on challenge requests 2018-03-23 02:09:05 +01:00
WsFederation #43 Add Microsoft.AspNetCore.Authentication.WsFederation, samples, and tests. 2018-02-26 15:31:39 -08:00
AuthenticationMiddlewareTests.cs
Base64UrlTextEncoderTests.cs
ClaimActionTests.cs Add ClaimActions for bulk add and remove. #1609 2018-03-21 16:35:37 -07:00
CookieTests.cs Clone tickets for sliding refresh #1607 2018-03-06 08:56:45 -08:00
DynamicSchemeTests.cs
FacebookTests.cs Allow overwriting parameters on challenge requests 2018-03-23 02:09:05 +01:00
GoogleTests.cs Allow overwriting parameters on challenge requests 2018-03-23 02:09:05 +01:00
JwtBearerTests.cs
Microsoft.AspNetCore.Authentication.Test.csproj Embed OIDC metadata and mock out the backchannel #1686 2018-03-20 12:42:16 -07:00
MicrosoftAccountTests.cs Allow overwriting parameters on challenge requests 2018-03-23 02:09:05 +01:00
OAuthChallengePropertiesTest.cs Allow overwriting parameters on challenge requests 2018-03-23 02:09:05 +01:00
OAuthTests.cs Allow overwriting parameters on challenge requests 2018-03-23 02:09:05 +01:00
PolicyTests.cs Rename VirtualScheme => PolicyScheme (#1665) 2018-03-13 11:09:43 -07:00
SecureDataFormatTests.cs
TestClock.cs
TestExtensions.cs
TestHandlers.cs
TestHttpMessageHandler.cs
TicketSerializerTests.cs
TokenExtensionTests.cs
Transaction.cs
TwitterTests.cs
katanatest.redmond.corp.microsoft.com.cer
selfSigned.cer