I found that I was able to log in with the email address and after that, I was able to log in normally with the username.
Is there something I can update so this isn't necessary?
Greetings Programs!
I have been working on migrating a 4.x MVC application to an 8.4 Angular + Core application.
I have LDAP enabled with multi-tenancy and I moved all the users over along with their roles (accounting for column changes).
When I try to log in using credentials ( testing with two users), I receive the "Email 'myemail' is already taken" error. It seems like it couldn't find the user and is trying to add the user instead of logging in.
The log in production doesn't seem to be showing the error but in dev, I get the output below.
Thanks,
Wg
Mvc.ExceptionHandling.AbpExceptionFilter - Email '[email protected]' is already taken.
Abp.UI.UserFriendlyException: Email '[email protected]' is already taken.
at Abp.Authorization.Users.AbpUserManager`2.CheckDuplicateUsernameOrEmailAddressAsync(Nullable`1 expectedUserId, String userName, String emailAddress)
at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation)
at Abp.Authorization.Users.AbpUserManager`2.CreateAsync(TUser user)
at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation)
at Abp.Authorization.AbpLogInManager`3.TryLoginFromExternalAuthenticationSourcesAsync(String userNameOrEmailAddress, String plainPassword, TTenant tenant)
at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation)
at Abp.Authorization.AbpLogInManager`3.LoginAsyncInternal(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout)
at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation)
at Abp.Authorization.AbpLogInManager`3.LoginAsync(String userNameOrEmailAddress, String plainPassword, String tenancyName, Boolean shouldLockout)
at Abp.Domain.Uow.UnitOfWorkInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation)
at MyAppInc.Web.Controllers.TokenAuthController.GetLoginResultAsync(String usernameOrEmailAddress, String password, String tenancyName) in C:\Projects\Core + Angular - 8.4\MyAppInc\aspnet-core\src\MyAppInc.Web.Core\Controllers\TokenAuthController.cs:line 652
at MyAppInc.Web.Controllers.TokenAuthController.Authenticate(AuthenticateModel model) in C:\Projects\Core + Angular - 8.4\MyAppInc\aspnet-core\src\MyAppInc.Web.Core\Controllers\TokenAuthController.cs:line 138
at lambda_method(Closure , Object )
at Microsoft.Extensions.Internal.ObjectMethodExecutorAwaitable.Awaiter.GetResult()
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
Thanks very much @ismcagdas!
Greetings Programs!
I am running two applications; one using v4.1.0 MVC and another using v8.0.0 CORE + Angular (which is planned to be upgraded to v8.2.1).
Are the changes Microsoft is planning for LDAP going to affect either versions of the application?
https://support.microsoft.com/en-ca/help/4520412/2020-ldap-channel-binding-and-ldap-signing-requirement-for-windows
Thanks,
Wg
Hi @maliming,
I am using Castle.Core.Logging and injecting ILogger for the _ logger instance, is this correct?
Thanks,
Wg
Greetings Programs!
I've got a method with a try/catch in which I throw a UserFriendlyException.
I'm going to be calling it from a hangfire job now within a foreach loop and I was wondering if there is a way to log the exception without throwing it so it doesn't stop the job?
Thanks,
Wg
Hi @maliming,
Yes, using that code is bringing in the default display name configured in Settings.
Thank!
Wg
Hi @maliming, it's the same with other email addresses and email clients (Outlook, iPhone Mail)
Greetings Programs!
I am using the following to send a message but when I receive the email, it is not using the default display name saved in the SMTP settings.
await _emailSender.SendAsync(new MailMessage
{
To = { recipient },
Subject = email.Subject,
Body = email.Message,
IsBodyHtml = true
});
The default email in the SMTP settings is set to [email protected] and the default display name is set to Notifications. When I receive emails in my gmail account, it displays as Do-Not-Reply <[email protected]> instead of Notifications which is what I'm expecting.
Thanks,
Wg
@alexanderpilhar, thanks for the note about rebuilding multiple times; I got it working after this without the need to call AddMvc().
With @alexanderpilhar, suggestion, I did the following:
Thanks,
Wg