Merge pull request #3721 from sbwalker/dev
use new Cascading Authentication State Services
This commit is contained in:
commit
1663731489
|
@ -10,6 +10,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
public static IServiceCollection AddOqtaneAuthorization(this IServiceCollection services)
|
public static IServiceCollection AddOqtaneAuthorization(this IServiceCollection services)
|
||||||
{
|
{
|
||||||
services.AddAuthorizationCore();
|
services.AddAuthorizationCore();
|
||||||
|
services.AddCascadingAuthenticationState();
|
||||||
services.AddScoped<IdentityAuthenticationStateProvider>();
|
services.AddScoped<IdentityAuthenticationStateProvider>();
|
||||||
services.AddScoped<AuthenticationStateProvider>(s => s.GetRequiredService<IdentityAuthenticationStateProvider>());
|
services.AddScoped<AuthenticationStateProvider>(s => s.GetRequiredService<IdentityAuthenticationStateProvider>());
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,9 @@
|
||||||
@if (string.IsNullOrEmpty(_installation.Message))
|
@if (string.IsNullOrEmpty(_installation.Message))
|
||||||
{
|
{
|
||||||
<div style="@_display">
|
<div style="@_display">
|
||||||
<CascadingAuthenticationState>
|
<CascadingValue Value="@PageState">
|
||||||
<CascadingValue Value="@PageState">
|
<SiteRouter RenderMode="@RenderMode" Runtime="@Runtime" VisitorId="@VisitorId" OnStateChange="@ChangeState" />
|
||||||
<SiteRouter RenderMode="@RenderMode" Runtime="@Runtime" VisitorId="@VisitorId" OnStateChange="@ChangeState" />
|
</CascadingValue>
|
||||||
</CascadingValue>
|
|
||||||
</CascadingAuthenticationState>
|
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -108,6 +108,9 @@ namespace Oqtane
|
||||||
|
|
||||||
services.ConfigureOqtaneIdentityOptions(Configuration);
|
services.ConfigureOqtaneIdentityOptions(Configuration);
|
||||||
|
|
||||||
|
services.AddCascadingAuthenticationState();
|
||||||
|
services.AddAuthorization();
|
||||||
|
|
||||||
services.AddAuthentication(options =>
|
services.AddAuthentication(options =>
|
||||||
{
|
{
|
||||||
options.DefaultScheme = Constants.AuthenticationScheme;
|
options.DefaultScheme = Constants.AuthenticationScheme;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user