hi
Abp uses OpenIddict as an OAuth server.
You can get and refresh the token by its endpoints.
https://www.oauth.com/
hi
Please use using for _currentTenant and ICurrentPrincipalAccessor
using(_currentTenant.Change(eventData.TenantId))
{
var newPrincipal = new ClaimsPrincipal(
new ClaimsIdentity(
new Claim[] {
new Claim(AbpClaimTypes.UserId, eventData.CreatorId.ToString()),
new Claim(AbpClaimTypes.TenantId, eventData.TenantId.ToString()),
new Claim(AbpClaimTypes.UserName, "admin")
}
)
);
using(_currentPrincipalAccessor.Change(newPrincipal))
{
var detail = await _bulkActionDetailRepository.GetAsync(x => x.BulkActionId == eventData.BulkActionId && x.FileDescriptorId == eventData.FileDescriptorId);
if (detail != null)
{
detail.Status = eventData.Status;
detail.StatusDetail = eventData.StatusMessage;
await _bulkActionDetailRepository.UpdateAsync(detail, true);
}
}
}
There is no API to get this. You can create your own, or just get a setting from javascript.
https://docs.abp.io/en/abp/latest/UI/AspNetCore/JavaScript-API/Settings
hi
var defaultLanguage = await settingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage);
https://docs.abp.io/en/abp/latest/Settings#reading-the-setting-values
I don't remember EnableLocalLogin ever having such a bug. It should have been changed in the UI.
I tried delete all the records in the PermissionGrant table
What were the previous records?
using System;
using System.Security.Principal;
using System.Threading.Tasks;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Security.Claims;
namespace FM.Test.Blazor;
public class AbpMultiTenantHubFilter : IHubFilter
{
public virtual async ValueTask<object> InvokeMethodAsync(HubInvocationContext invocationContext, Func<HubInvocationContext, ValueTask<object>> next)
{
var currentPrincipalAccessor = invocationContext.ServiceProvider.GetRequiredService<ICurrentPrincipalAccessor>();
using (currentPrincipalAccessor.Change(invocationContext.Context.User))
{
var tenantId = currentPrincipalAccessor.Principal.FindTenantId();
string tenantName = null;
if (tenantId != null)
{
tenantName = (await invocationContext.ServiceProvider.GetRequiredService<ITenantStore>().FindAsync(tenantId.Value))?.Name;
}
using (invocationContext.ServiceProvider.GetRequiredService<ICurrentTenant>().Change(currentPrincipalAccessor.Principal.FindTenantId(), tenantName))
{
return await next(invocationContext);
}
}
}
public virtual Task OnConnectedAsync(HubLifetimeContext context, Func<HubLifetimeContext, Task> next)
{
return Task.CompletedTask;
}
public virtual Task OnDisconnectedAsync(HubLifetimeContext context, Exception exception, Func<HubLifetimeContext, Exception, Task> next)
{
return Task.CompletedTask;
}
}