Commit Graph

114 Commits

Author SHA1 Message Date
Ryan Brandenburg b8a488bf9e Set 2.1 baselines 2018-06-14 16:42:18 -07:00
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
Ryan Brandenburg 46e62b2b67 Set 2.0 baselines 2018-03-21 11:46:17 -07:00
Hao Kung c0b8be58ba
Add scheme forwarding (authN policies) (#1625) 2018-02-01 14:40:56 -08:00
Chris Ross (ASP.NET) dde7671c06 OIDC: Use IdentityModel redirect form generator #1448 2018-01-08 09:23:06 -08:00
Chris Ross (ASP.NET) f8b4f4c620 Add consent to CookiePolicy #1561 2017-12-27 13:38:18 -08:00
Nate McMaster bd8ecd0268 Pin tool and package versions to make builds more repeatable
Part of aspnet/Universe#575
2017-11-01 16:37:42 -07:00
Chris Ross (ASP.NET) bd07f8b683 #1353 use a compliant Expires header value for expiration. 2017-10-11 12:40:15 -07:00
Chris Ross (ASP.NET) 0904af8ff3 PR style cleanup 2017-10-09 11:45:51 -07:00
OpenIDAuthority e34a5f8fb8 Add MaxAge to OpenIdConnectOptions
- max_age parameter added to the authentication request if MaxAge is not null
 - throws exception if MaxAge is set to a negative value
 - Fractions of seconds are ignored
 - See http://openid.net/specs/openid-connect-core-1_0.html#AuthRequest for expected behavior

Addresses #1233
2017-10-09 11:45:51 -07:00
Gareth Brading 4a6c74f4f9 Added ability to set prompt parameter in OpenIdConnectOptions (#1401) 2017-09-28 14:03:52 -07:00
Chris R 144ee21696 #1188 Add AuthenticationProperties to HandleRequestResult and RemoteFailureContext 2017-09-27 14:18:42 -07:00
Javier Calvarro Nelson 5abcfe7e3d Update API check baselines to 2.0 2017-09-22 17:24:10 -07:00
Chris Ross (ASP.NET) 13fdbac48f #942 Add the SignedOutCallbackRedirect event for OIDC 2017-09-22 15:29:15 -07:00
Hao Kung 863846bb2a Cleanup resx (#1424) 2017-09-14 10:59:59 -07:00
Nate McMaster a53bf093a7 Use PackageLineup to manage PackageReference versions 2017-08-29 15:26:04 -07:00
Nate McMaster 724be48ee9 Use Directory.Build.props/targets 2017-08-29 15:24:01 -07:00
Hao Kung d797543cfc Update obsolete error (#1346) 2017-08-03 12:59:45 -07:00
richstokoe 827852efdb Corrected typos in XML Docs in MessageReceivedContext for events in JwtBearer and OpenIdConnect middlesware. (#1336) 2017-07-24 08:49:49 -07:00
Chris R 36d3d97b99 #1319 Add DisplayName overloads 2017-07-13 15:20:24 -07:00
Hao Kung 23da476176 Switch to IOptionsMonitor (#1295) 2017-07-06 13:41:47 -07:00
Chris R 658f4621b1 #1208 Clean up JWT and OIDC issuer handling 2017-07-05 14:44:23 -07:00
Hao Kung 1c30f33c92 Remove AddXyzAuth extension methods 2017-07-05 13:00:40 -07:00
Nate McMaster 968237d751 Replace configure method on Twitter, RemoteAuthentication, and OpenIdConnect options with CookieBuilder 2017-07-05 09:56:12 -07:00
Hao Kung ff9f145a8e Refactor Events + Add IAuthenticationBuilder 2017-06-29 16:27:03 -07:00
Javier Calvarro Nelson 879f0b7f40 [Fixes #1133] Limit the path on the nonce and correlation id cookies 2017-06-15 11:23:05 -07:00
Chris R 200ce72312 Rename PostLogoutRedirectUri to avoid spec confusion 2017-06-13 15:20:54 -07:00
Hao Kung 9797d4bc5f Reenable API check 2017-06-12 14:58:11 -07:00
Chris R bc3c4e9f12 #1200 Doc comments for OnRedirectToIdentityProvider 2017-06-09 16:23:47 -07:00
Pranav K 4a258b4565 Remove usage of TaskCache 2017-06-08 09:01:00 -07:00
Hao Kung ae3dfcdb32 Remote ConfigureDefaultOptions 2017-06-05 11:34:35 -07:00
Hao Kung db9ae62632 IInitializeOptions => IPostConfigureOptions 2017-06-02 14:28:03 -07:00
John Luo c523839078 Update default settings for SameSite
- Need Lax policy for social authentication
- Need None policy for OIDC
2017-05-26 12:19:18 -07:00
Hao Kung e940cdb36b AuthZ 2.0 changes + react to Http 2017-05-25 18:29:19 -07:00
Chris R 30392a1811 Retarget to netstandard2.0 and net461 2017-05-24 19:04:48 -07:00
John Luo 769da5fd87 Add SameSitePolicy to CookiePolicyMiddleware 2017-05-23 09:55:11 -07:00
Hao Kung 1f5a27e20a Switch to Options Initializer 2017-05-17 14:05:27 -07:00
Pavel Krymets 36605636df Remove unnecessary package references (#1210) 2017-05-10 11:47:56 -07:00
Chris R d84abf1fe6 Migrate to netcoreapp2.0 (#1202)
* Migrate to netcoreapp2.0, remove Microsoft.Owin.Security.Interop & tests.

* Remove net45 baselines
2017-05-04 19:26:44 -07:00
Hao Kung 4f20655850 Set DisplayName for auth 2017-04-20 14:19:32 -07:00
Hao Kung da30688fa9 Disable api checks for now 2017-04-19 13:58:38 -07:00
Hao Kung 99aa3bd35d Auth 2.0 2017-04-19 13:00:03 -07:00
Pranav K b8eae7a697 Add reference to System.Security.Claims 2017-03-22 06:04:21 -07:00
Pranav K ffa45dbd01 Change compilation targets.
* Remove net451 as a compilation target
* Upgrade to netcoreapp2.0
2017-03-22 06:04:21 -07:00
Nate McMaster 10ef26d63c Consolidate dependency versions into one file and remove workarounds 2017-03-15 18:12:53 -07:00
Kévin Chalet 32dd435c6e Add an opt-out DisableTelemetry option in the OpenID Connect middleware (#1140) 2017-03-13 10:02:59 -07:00
Chris R ad425163b2 #969 Make social auth claims mapping more configurable
#1024 Remove OIDC protocol claims
2017-03-01 10:55:30 -08:00
Nate McMaster 9847f40654
Downgrade to stable packages 2017-02-14 16:15:42 -08:00
Pranav K c18a3d3a7d Revert "Revert "Update OpenId package versions""
This reverts commit 0113df6075.
2017-01-31 06:51:51 -08:00
Pranav K 0113df6075 Revert "Update OpenId package versions"
This reverts commit a031c4badb.
2017-01-30 11:10:41 -08:00