ABP Framework version: v4.3.1 UI type: Angular DB provider: EF Core Tiered (MVC) or Identity Server Separated (Angular): yes
We have custom login page and using AWS SES for sending emails. Steps performed
Code added in Login components <a href="/account/forgot-password" class="forgot_pass_cl"> {{ 'AbpAccount::ForgotPassword' | abpLocalization }}</a>
When we click on Forgot Password? Its redirected to url http://localhost:4200/account/forgot-password
We are entering aws certified email on submit its calling api https://localhost:44359/api/account/send-password-reset-code The response of api is Status Code: 403 Forbidden JSON Response {"error":{"code":null,"message":"Can not find the given email address:Ish***** **@****s.com","details":null,"data":{},"validationErrors":null}}
Downloaded latest package Volo.Abp.Identity.AspNetCore package in Lit***.HttpApi project
Define this package in the LitHttpApiModule class in the LitName.HttpApi project
Added entry in Lit***.HttpApi.Host project appsettings.json "App": { "ClientUrl": "http://localhost:4200", }
ConfigureUrls options.Applications["Angular"].RootUrl = configuration["App:ClientUrl"]; options.Applications["Angular"].Urls[AccountUrlNames.PasswordReset] = "account/reset-password"; options.Applications["Angular"].Urls[AccountUrlNames.EmailConfirmation] = "account/email-confirmation";
Added ConfigureUrls To ConfigureServices() method in Lit***HttpApiHostModule class
Getting 403 Forbidden error, please advise.
8 Answer(s)
-
0
The response of api is Status Code: 403 Forbidden
Can not find the given email address:Ish @s.com
It will throw an
UserFriendlyException
exception when the GetUserByEmail method cannot find user, and its status code will be 403, which is by design.protected virtual async Task<IdentityUser> GetUserByEmail(string email) { var user = await UserManager.FindByEmailAsync(email); if (user == null) { throw new UserFriendlyException(L["Volo.Account:InvalidEmailAddress", email]); } return user; }
https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/DefaultHttpExceptionStatusCodeFinder.cs#L72
-
0
The response of api is Status Code: 403 Forbidden
Can not find the given email address:Ish @s.com
It will throw an
UserFriendlyException
exception when the GetUserByEmail method cannot find user, and its status code will be 403, which is by design.protected virtual async Task<IdentityUser> GetUserByEmail(string email) { var user = await UserManager.FindByEmailAsync(email); if (user == null) { throw new UserFriendlyException(L["Volo.Account:InvalidEmailAddress", email]); } return user; }
https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/ExceptionHandling/DefaultHttpExceptionStatusCodeFinder.cs#L72
hi,
Actually this is not the issue. We have enabled the Forgot Password flow into front-end and ABP uses SMTP for sending email notifications.
For our project, we are using AWS SES service for sending email notification to users. All the example we have seen for forgot password are using SMTP methods. Will you please guide us how to utilize forgot password feature with AWS SES method?
This is one important ask our product owner is looking and we would like to finish this feature ASAP. We will appreciate your quick response
-
0
hi
You can implementation your own
AWSSESEmailSender
, Just likeMailKitSmtpEmailSender
.https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/MailKitSmtpEmailSender.cs#L15 https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/AbpMailKitModule.cs https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/IMailKitSmtpEmailSender.cs https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/AbpMailKitOptions.cs
-
0
hi
You can implementation your own
AWSSESEmailSender
, Just likeMailKitSmtpEmailSender
.https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/MailKitSmtpEmailSender.cs#L15 https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/AbpMailKitModule.cs https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/IMailKitSmtpEmailSender.cs https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.MailKit/Volo/Abp/MailKit/AbpMailKitOptions.cs
Hi,
Please note we already have a SESEmailSender class in our project which is used to send out email notifications thru AWS SES. We want to understand how to invoke/integrate email send method of this class when password is reset by clicking "Forgot Password" ? In the interest of time, can we have a quick call remotely to understand and resolve this issue?
-
0
hi
Is your
SESEmailSender
implement theIEmailSender
and replace default one in the DI?Account Pro will use
IEmailSender
to send emails by default.https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/IEmailSender.cs#L9
-
0
This question has been automatically marked as stale because it has not had recent activity.
-
0
hi
Is your
SESEmailSender
implement theIEmailSender
and replace default one in the DI?Account Pro will use
IEmailSender
to send emails by default.https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Emailing/Volo/Abp/Emailing/IEmailSender.cs#L9
When creating a custom email sender (SESEmailSender in this case) that implements IEmailSender, how does one have Account Pro register the custom email sender to the DI?
-
-1
hi
public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.Replace(ServiceDescriptor.Singleton<IEmailSender, SESEmailSender>()); }