yes
your ticket was refunded
Hi,
I can confirm the problem, we will fix it in the next version.
You can try:
public class MyAbpAccountAuthenticationRequestHandler<TOptions, THandler> : IAuthenticationRequestHandler, IAuthenticationSignOutHandler
where TOptions : RemoteAuthenticationOptions, new()
where THandler : RemoteAuthenticationHandler<TOptions>
{
protected readonly THandler InnerHandler;
protected readonly IOptions<TOptions> OptionsManager;
public MyAbpAccountAuthenticationRequestHandler(THandler innerHandler, IOptions<TOptions> optionsManager)
{
InnerHandler = innerHandler;
OptionsManager = optionsManager;
}
public virtual async Task InitializeAsync(AuthenticationScheme scheme, HttpContext context)
{
await InnerHandler.InitializeAsync(scheme, context);
}
public virtual async Task<AuthenticateResult> AuthenticateAsync()
{
return await InnerHandler.AuthenticateAsync();
}
public virtual async Task ChallengeAsync(AuthenticationProperties properties)
{
await OptionsManager.SetAsync(InnerHandler.Scheme.Name);
ObjectHelper.TrySetProperty(InnerHandler, handler => handler.Options, () => OptionsManager.Value);
await InnerHandler.ChallengeAsync(properties);
}
public virtual async Task ForbidAsync(AuthenticationProperties properties)
{
await InnerHandler.ForbidAsync(properties);
}
public async Task SignOutAsync(AuthenticationProperties properties)
{
await OptionsManager.SetAsync(InnerHandler.Scheme.Name);
ObjectHelper.TrySetProperty(InnerHandler, handler => handler.Options, () => OptionsManager.Value);
var signOutHandler = InnerHandler as IAuthenticationSignOutHandler;
if (signOutHandler == null)
{
throw new InvalidOperationException($"The authentication handler registered for scheme '{InnerHandler.Scheme}' is '{InnerHandler.GetType().Name}' which cannot be used for SignOutAsync");
}
await signOutHandler.SignOutAsync(properties);
}
public virtual async Task<bool> HandleRequestAsync()
{
if (await InnerHandler.ShouldHandleRequestAsync())
{
await OptionsManager.SetAsync(InnerHandler.Scheme.Name);
ObjectHelper.TrySetProperty(InnerHandler, handler => handler.Options, () => OptionsManager.Value);
}
return await InnerHandler.HandleRequestAsync();
}
public virtual THandler GetHandler()
{
return InnerHandler;
}
}
public static class AuthenticationBuilderExtensions
{
public static AuthenticationBuilder AddMyAbpAccountDynamicOptions<TOptions, THandler>(this AuthenticationBuilder authenticationBuilder)
where TOptions : RemoteAuthenticationOptions, new()
where THandler : RemoteAuthenticationHandler<TOptions>
{
authenticationBuilder.Services.AddScoped(typeof(AccountExternalProviderOptionsManager<TOptions>));
authenticationBuilder.Services.Replace(ServiceDescriptor.Scoped(typeof(IOptions<TOptions>),
provider => provider.GetRequiredService<AccountExternalProviderOptionsManager<TOptions>>()));
authenticationBuilder.Services.Replace(ServiceDescriptor.Scoped(typeof(IOptionsSnapshot<TOptions>),
provider => provider.GetRequiredService<AccountExternalProviderOptionsManager<TOptions>>()));
authenticationBuilder.Services.Replace(ServiceDescriptor.Scoped(typeof(IOptionsMonitor<TOptions>),
provider => provider.GetRequiredService<AccountExternalProviderOptionsManager<TOptions>>()));
authenticationBuilder.Services.Replace(ServiceDescriptor.Transient<IOptionsFactory<TOptions>, AccountExternalProviderOptionsFactory<TOptions>>());
var handler = authenticationBuilder.Services.LastOrDefault(x => x.ServiceType == typeof(THandler));
authenticationBuilder.Services.Replace(new ServiceDescriptor(
typeof(THandler),
provider => new MyAbpAccountAuthenticationRequestHandler<TOptions, THandler>(
(THandler)ActivatorUtilities.CreateInstance(provider, typeof(THandler)),
provider.GetRequiredService<IOptions<TOptions>>()),
handler?.Lifetime ?? ServiceLifetime.Transient));
return authenticationBuilder;
}
}
context.Services.AddAuthentication()
.AddOpenIdConnect("AzureAD", "Azure AD", options =>
{
options.ResponseType = OpenIdConnectResponseType.CodeIdToken;
options.RequireHttpsMetadata = false;
options.SaveTokens = true;
options.GetClaimsFromUserInfoEndpoint = true;
options.Scope.Add("email");
options.ClaimActions.MapJsonKey(ClaimTypes.NameIdentifier, "sub");
options.CallbackPath = configuration["AzureAd:CallbackPath"];
})
.AddMyAbpAccountDynamicOptions<OpenIdConnectOptions, OpenIdConnectHandler>()
.Services.AddDynamicExternalLoginProviderOptions<OpenIdConnectOptions>("AzureAD",
options =>
{
options.WithProperty(x => x.Authority);
options.WithProperty(x => x.ClientId);
options.WithProperty(x => x.ClientSecret, isSecret: true);
});
[Route("connect/logout")]
[ApiExplorerSettings(IgnoreApi = true)]
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(LogoutController))]
public class MyLogoutController : LogoutController
{
[HttpGet]
public override async Task<IActionResult> GetAsync()
{
await SignInManager.SignOutAsync();
return SignOut(authenticationSchemes: "AzureAD");
}
}
Hi,
i could not reproduce the problem
You can upgrade the leptonx package to 3.1.4
Hi,
This is a bug, we will fix it in the next patch version.
This is a temporary solution
@using Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components.ApplicationLayout.Common
@using Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components.ApplicationLayout.SideMenu.Navigation
@using Volo.Abp.DependencyInjection
@using Volo.Abp.Ui.Branding
@inject IBrandingProvider BrandingProvider
@inherits Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components.ApplicationLayout.SideMenu.Navigation.MobileNavbar
@attribute [ExposeServices(typeof(MobileNavbar))]
<div class="lpx-mobile-navbar-container">
<div class="lpx-mobile-navbar">
<div class="lpx-mobile-nav-tab-left">
<ul class="lpx-mobile-nav-tabs">
@if(SelectedMenuItems is not null)
{
foreach (var viewModel in SelectedMenuItems)
{
<li class="lpx-mobile-nav-tab">
<a id="@viewModel.MenuItem.ElementId" href="@viewModel.MenuItem.Url" target="@viewModel.MenuItem.Target" class="lpx-mobile-nav-item @viewModel.MenuItem.CssClass">
<i class="menu-item-icon @viewModel.MenuItem.Icon" aria-hidden="true"></i>
<span class="mobile-item-text">@viewModel.MenuItem.DisplayName</span>
</a>
</li>
}
}
</ul>
<div class="lpx-mobile-nav-tab-center">
<a href="javascript:void(0)" class="lpx-mobile-hamburger" data-lpx-mobile-menu-toggle="routes">
<span class="hamburger-icon" aria-hidden="true">
<span class="icon-part"></span>
<span class="icon-part"></span>
<span class="icon-part"></span>
<span class="icon-part"></span>
<span class="icon-part"></span>
<span class="icon-part"></span>
</span>
</a>
</div>
<div class="lpx-mobile-nav-tab-right">
<ul class="lpx-mobile-nav-tabs">
<li class="lpx-mobile-nav-tab">
<a class="lpx-mobile-nav-item" data-lpx-mobile-menu-toggle="settings">
<i class="menu-item-icon bi bi-gear-wide-connected" aria-hidden="true"></i>
<span class="mobile-item-text">@L["Settings"]</span>
</a>
</li>
<li class="lpx-mobile-nav-tab">
<AuthorizeView>
<Authorized>
<a class="lpx-mobile-nav-item" data-lpx-mobile-menu-toggle="user">
<div class="lpx-avatar">
<img class="lpx-avatar-img" src="@ProfileImageUrl" alt="@CurrentUser.UserName avatar" />
</div>
<span class="mobile-item-text">@CurrentUser.UserName</span>
</a>
</Authorized>
<NotAuthorized>
<a href="@LoginLink" class="lpx-mobile-nav-item">
<i class="menu-item-icon bi bi-person-fill" aria-hidden="true"></i>
<span class="mobile-item-text">@L["Login"]</span>
</a>
</NotAuthorized>
</AuthorizeView>
</li>
</ul>
</div>
</div>
</div>
<div class="lpx-mobile-menu hidden">
<div class="lpx-logo-container">
<a href="">
<div class="lpx-brand-logo"></div>
@if(BrandingProvider.LogoUrl.IsNullOrEmpty())
{
<div class="lpx-brand-name">@BrandingProvider.AppName</div>
}
</a>
</div>
<ul class="lpx-nav-menu d-none" data-lpx-mobile-menu="routes">
<MainMenu />
</ul>
<ul class="lpx-nav-menu d-none" data-lpx-mobile-menu="settings">
<MobileGeneralSettings />
</ul>
<ul class="lpx-nav-menu d-none" data-lpx-mobile-menu="user">
<div class="d-flex ps-3 pe-3">
<div class="lpx-avatar me-2">
<img class="lpx-avatar-img" src="@ProfileImageUrl" alt="@CurrentUser.UserName avatar" />
</div>
<div class="d-flex flex-column" style="line-height: normal">
<span class="lpx-context-menu-user-name">@CurrentUser.Name @CurrentUser.SurName</span>
@if (CurrentTenant.IsAvailable)
{
<span class="lpx-context-menu-user-tenant">@CurrentTenant.Name</span>
}
<span class="lpx-context-menu-user-email">@CurrentUser.Email</span>
</div>
</div>
@if (UserMenu != null)
{
foreach (var menuItem in UserMenu.Items)
{
<li class="outer-menu-item">
<a class="lpx-menu-item-link lpx-menu-item @menuItem.CssClass" href="@menuItem.Url?.TrimStart('/', '~')" target="@menuItem.Target" id="@menuItem.ElementId">
<span class="lpx-menu-item-icon"><i class="lpx-icon @menuItem.Icon" aria-hidden="true"></i></span>
<span class="lpx-menu-item-text hidden-in-hover-trigger">@menuItem.DisplayName</span>
</a>
</li>
}
}
<li><hr class="my-2"></li>
@if (Toolbar != null)
{
foreach (var item in Toolbar.Items)
{
if(item.ComponentType.Name == "MainHeaderToolbarUserMenu")
{
continue;
}
<div class="outer-menu-item">
<DynamicComponent Type="@item.ComponentType" />
</div>
}
}
</ul>
</div>
</div>
Hi,
I received the email, but I can't download it. Could you send it again with https://wetransfer.com/. thanks.
the ticket was refunded.
HI,
You can check the document:
https://docs.abp.io/en/abp/latest/Distributed-Event-Bus#configuration
https://docs.abp.io/en/abp/latest/Distributed-Event-Bus#event-transfer-object