VirtoCommerce / vc-platform-core

Project moved to https://github.com/VirtoCommerce/vc-platform/tree/release/3.0.0
Other
38 stars 32 forks source link

Fix startup exception when AzureAD is configured. #540

Closed keberle closed 5 years ago

keberle commented 5 years ago

If you configure Azure AD the following exception is thrown at startup:

Unhandled Exception: System.InvalidOperationException: The OpenIddict validation handler cannot be registered as an authentication scheme. This may indicate that an instance of the OAuth validation or JWT bearer handler was registered. Make sure that neither 'services.AddAuthentication().AddOAuthValidation()' nor 'services.AddAuthentication().AddJwtBearer()' are called from 'ConfigureServices'.

Removing the "AddOAuthValidation" line from the AddAuthentication allows AzureAD users to access the admin UI.

tatarincev commented 5 years ago

@keberle I've applied your PR by this commit https://github.com/VirtoCommerce/vc-platform-core/commit/465683ca69ea007dd021f22910c0195979b2f18b. All works as expected now.