can you please let me know how i can do this ??
In our use case the users are not allowed to change their username so i have override the UpdatAsync to be as follows
(await UserManager.SetUserNameAsync(user, input.UserName)).CheckErrors();
The above line is what changes the SecurityStamp which forces the user out because we are using AbpSecurityStampValidator
to ensure that the same user cant be signed in concurrently using the same username.
public override async Task<IdentityUserDto> UpdateAsync(Guid id, IdentityUserUpdateDto input)
{
//ADDED BY VB: To check if all Roles avalible as per license have been consumed.
if (CurrentUser.UserName != "dfo.admin")
{
await CheckCurrentTenantsLicenseConsumed(id, input);
}
await IdentityOptions.SetAsync();
var user = await UserManager.GetByIdAsync(id);
user.ConcurrencyStamp = input.ConcurrencyStamp;
if (!string.Equals(user.UserName, input.UserName, StringComparison.InvariantCultureIgnoreCase))
{
if (await SettingProvider.IsTrueAsync(IdentitySettingNames.User.IsUserNameUpdateEnabled))
{
(await UserManager.SetUserNameAsync(user, input.UserName)).CheckErrors();
}
}
await UpdateUserByInput(user, input);
input.MapExtraPropertiesTo(user);
(await UserManager.UpdateAsync(user)).CheckErrors();
await CurrentUnitOfWork.SaveChangesAsync();
var userDto = ObjectMapper.Map<Volo.Abp.Identity.IdentityUser, IdentityUserDto>(user);
//ADDED BY VB: To send an email to the user notifying their prifile has changed
var ppmUser = await GetUserByEmail(input.Email);
await _subscriptionEmailer.SendPpmUserUpdatedEmailAsync(ppmUser, "MVC");
return userDto;
}
Thanks for you help @liangshiwei
We want to embed a link in a userfriendlymessage message which is thrown in a AppService
how can we achive this?
I have discoverd a side effect when implementing this in our application to deal with concurrent user.
It seems when we updated the user via his profile or in the users table under Identity the security stamp is updated and the user is logged out.
can you please suggest how we can over come this, if the user is updating his profile or via the user table the user shouldn't update its seucirty stamp.
abp suite
Create new Solutions
buttonIssues found
i have tried that it does wirk unless the user is authenticated
When the user is not logged in I would like to user the __teantid= parament to set the teannt but it doesn't seem to be working.
can you please help
We would like to automatically login in the user when they Confirm their Phone Number or Reset their Password using the forgot password feature, having the user redirected to the login screen or a confirmation screen adds confusion.
In the below code there is a task //TODO: Try to automatically login!
can we please have the solution so we can use it in our SaaS product for DesertFire?
public virtual async Task<IActionResult> OnPostAsync()
{
try
{
ValidateModel();
SetNormalizeReturnUrl();
await AccountAppService.ResetPasswordAsync(
new ResetPasswordDto
{
UserId = UserId,
ResetToken = ResetToken,
Password = Password
}
);
}
catch (Exception e)
{
if (e is AbpIdentityResultException && !string.IsNullOrWhiteSpace(e.Message))
{
Alerts.Warning(GetLocalizeExceptionMessage(e));
return Page();
}
if (e is AbpValidationException)
{
return Page();
}
throw;
}
//TODO: Try to automatically login!
return RedirectToPage("./ResetPasswordConfirmation", new
{
returnUrl = NormalizeReturnUrl
});
}
I have deployed our app to Azure WebApp and are using DevOps pipelines to deploy using packaged deploy method using zp file
Seems when we do this ABP is unable to write the log to "Logs/logs.txt" becuase the wwwroot dir is set to read only by design
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
#if DEBUG
.WriteTo.Async(c => c.Console())
#endif
.CreateLogger();
what is the best way to write logs on azure?