Skip to content

Identity Endpoints - Lifetime IEmailSender #51289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
augustevn opened this issue Oct 11, 2023 · 3 comments
Open

Identity Endpoints - Lifetime IEmailSender #51289

augustevn opened this issue Oct 11, 2023 · 3 comments
Labels
area-identity Includes: Identity and providers enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-identity-service
Milestone

Comments

@augustevn
Copy link

augustevn commented Oct 11, 2023

          > I don't know if this is an issue or not but just want to mention that no matter what _lifetime_ the `IEmailSender` is added by user, It will always be created once.

That is a good point. That's the way I made MapIdentityApi work prior to this PR, but it is different from the Identity UI razor pages. The default no-op implementation is registered as a singleton.

Do you think it's common to need or want services from the request scope? I guess it probably wouldn't hurt. It's just another parameter to pass around.

Originally posted by @halter73 in #50301 (comment)


After testing with a few email integrations, I noticed there were scoping issues for working with FluentEmail SMTP.

A custom MailKit SMTP mailer worked fine.

@ghost ghost added the area-identity Includes: Identity and providers label Oct 11, 2023
@mkArtakMSFT mkArtakMSFT added enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-identity-service labels Oct 26, 2023
@mkArtakMSFT mkArtakMSFT added this to the Backlog milestone Oct 26, 2023
@ghost
Copy link

ghost commented Oct 26, 2023

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@Kahbazi
Copy link
Member

Kahbazi commented Oct 26, 2023

@halter73 Do you think this is something that needs to be done in v8.0? If so I can send a PR for this issue.

@halter73
Copy link
Member

It's too late for this kind of change in .NET 8. We'll consider making it a breaking change in .NET 9. In the meantime, you can work around this issue with IHttpContextAccessor and RequestServices or copy IdentityApiEndpointRouteBuilderExtensions which contains MapIdentityApi and resolve the service in a scope yourself. Everything you need should be contained in that single file now that the DTO types are public.

@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-identity Includes: Identity and providers enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-identity-service
Projects
None yet
Development

No branches or pull requests

5 participants