Commit Graph

57 Commits

Author SHA1 Message Date
Ryan Brandenburg aa24887d43 Set 2.1 baselines 2018-06-14 16:42:34 -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
Chris Ross (ASP.NET) 21acbf06e8 Update google auth endpoint to v2 #1307 2018-02-28 10:51:13 -08:00
Josh Coulter 0959c941b4 Cleaned up OAuth handler's exception messages (#1462) 2017-10-02 11:25:46 -07:00
Javier Calvarro Nelson 5abcfe7e3d Update API check baselines to 2.0 2017-09-22 17:24:10 -07:00
Hao Kung 1367a5d385 Make all handlers public 2017-09-19 15:32:28 -07:00
Hao Kung 863846bb2a Cleanup resx (#1424) 2017-09-14 10:59:59 -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
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
Hao Kung 1c30f33c92 Remove AddXyzAuth extension methods 2017-07-05 13:00:40 -07:00
Hao Kung ff9f145a8e Refactor Events + Add IAuthenticationBuilder 2017-06-29 16:27:03 -07:00
Hao Kung 9797d4bc5f Reenable API check 2017-06-12 14:58:11 -07:00
Hao Kung b795893542 Remove rogue using 2017-06-05 14:04:33 -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
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
Hao Kung 1f5a27e20a Switch to Options Initializer 2017-05-17 14:05:27 -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 99aa3bd35d Auth 2.0 2017-04-19 13:00:03 -07:00
Doug Bunting 75a4d006aa Disable API Check in projects with untracked breaking changes 2017-03-22 08:35:25 -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
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
Nate McMaster 7634c5420a Upgrade to RC.3
Removes __TemporarySources__ to use contentFiles packages
Remove default globs
Update test platform
2017-01-19 22:31:43 -08:00
Nate McMaster 861026cd76 Remove redundant references 2017-01-05 18:16:07 -08:00
Nate McMaster ba8f85d972 Upgrade to VS 2017 2017-01-05 13:53:05 -08:00
Pranav K 7ab28ecdc6 Updating to 4.4 CoreFx packages 2016-12-14 14:47:31 -08:00
Pranav K 46df38de68 Updating versions to 1.2.0-* 2016-11-09 14:19:34 -08:00
jacalvar 82c231efca Created public API baselines 2016-11-08 11:38:53 -08:00
Pranav K f64c864911 Updating partner package versions 2016-10-03 14:28:05 -07:00
Troy Dai ddeef1f9ac Add prompt parameter to Google auth endpoint 2016-09-23 10:44:41 -07:00
Troy Dai 0e855b25a8 Update Google and Microsoft Account Handler exception message 2016-07-26 14:16:16 -07:00
Troy Dai 5de4816f59 Update the RemoteAuthenticationHandler error handling
1. Exeption will be still thrown from CreateTicketAsync to avoid breaking
change.
2. OAuthHandler won't try to capture the exception.
3. OAuthHandler will check if the AuthenticateTicket is null.
4. RemoteAuthenticationHandler's error handling flow is improved to cover
the exception thrown from HandleRemoteAuthenticateAsync. The exeption
thrown from it will go throw the user error handling logic, too.
2016-07-26 10:30:50 -07:00
Troy Dai 312edaafb4 Handle back channel failure gracefully
1. Check the response states code. If it is out of 2XX range, compose a
readable message and throw in an exception.
2. Capture the exception in HandleRemoteAuthenticateAsync and translate
it into AuthenticateResult.
2016-07-26 10:30:50 -07:00
Troy Dai ecb3b90984 Undo change to the GoogleDefaults 2016-07-26 09:19:42 -07:00
Troy Dai eabdd45816 Improve code readability for Authentication.Google 2016-07-26 09:13:18 -07:00
Doug Bunting 792b316950 One build to rule them all
- well, at least VS and command-line builds will share output
- part of aspnet/Coherence-Signed#277
2016-07-07 12:40:05 -07:00
Pranav K d8d408638e Updating to dev versions
# Conflicts:
#	src/Microsoft.AspNetCore.Authentication.OAuth/project.json
#	src/Microsoft.AspNetCore.Authentication.Twitter/project.json
2016-06-16 11:31:40 -07:00
jacalvar e1495f5f32 Remove unncessary usings 2016-06-09 00:48:37 -07:00
Hao Kung db7009531a Update google token endpoint to v4 2016-05-23 10:31:36 -07:00
Pranav K f6cdb9faf9 Fix build warnings 2016-05-02 11:27:26 -07:00
Pranav K a41c578d88 Removing imports from src projects 2016-04-08 06:49:18 -07:00
Pranav K 22d133cefa Reacting to CoreCLR package changes 2016-03-22 14:51:18 -07:00
Eilon Lipton d78f7edfc7 Fix package metadata
And also a few other Core-related renames.
2016-03-09 23:14:51 -08:00
Ajay Bhargav Baaskaran 9dfe4d9699 Enabled xml doc generation 2016-03-04 15:49:20 -08:00