Prepare Startup.cs for netcoreapp30

This commit is contained in:
nicolas.dorier
2019-10-07 13:03:50 +09:00
parent 8ba1303968
commit 0cc2fa962d
2 changed files with 12 additions and 2 deletions

View File

@@ -211,6 +211,8 @@
<Content Update="Views\Wallets\WalletTransactions.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>
<Content Remove="Views\Server\EditGoogleCloudStorageStorageProvider.cshtml" Condition="'$(TargetFramework)' != 'netcoreapp2.1'">
</Content>
<Content Update="Views\Wallets\_Nav.cshtml">
<Pack>$(IncludeRazorContentInPack)</Pack>
</Content>

View File

@@ -198,7 +198,9 @@ namespace BTCPayServer.Hosting
options.AllowPasswordFlow();
options.AllowAuthorizationCodeFlow();
options.UseRollingTokens();
#if NETCOREAPP21
options.UseJsonWebTokens();
#endif
options.RegisterScopes(
OpenIdConnectConstants.Scopes.OpenId,
@@ -212,13 +214,19 @@ namespace BTCPayServer.Hosting
RestAPIPolicies.BTCPayScopes.ViewApps,
RestAPIPolicies.BTCPayScopes.AppManagement
);
#if NETCOREAPP21
options.AddEventHandler<PasswordGrantTypeEventHandler>();
options.AddEventHandler<AuthorizationCodeGrantTypeEventHandler>();
options.AddEventHandler<RefreshTokenGrantTypeEventHandler>();
options.AddEventHandler<ClientCredentialsGrantTypeEventHandler>();
options.AddEventHandler<LogoutEventHandler>();
#else
options.AddEventHandler(PasswordGrantTypeEventHandler.Descriptor);
options.AddEventHandler(AuthorizationCodeGrantTypeEventHandler.Descriptor);
options.AddEventHandler(RefreshTokenGrantTypeEventHandler.Descriptor);
options.AddEventHandler(ClientCredentialsGrantTypeEventHandler.Descriptor);
options.AddEventHandler(LogoutEventHandler.Descriptor);
#endif
options.ConfigureSigningKey(Configuration);
});
}