AspNetCore.Docs icon indicating copy to clipboard operation
AspNetCore.Docs copied to clipboard

ISmsSender not defined anywhere - Doesn't explain how to register it with the UserManager for sending

Open JohnGalt1717 opened this issue 8 years ago • 28 comments

The above code works by magic as far as I can tell because ISmsSender, unlike IEmailSender, is not defined anywhere I can find, and you're not defining it above. As a result, even looking at the GitHub sample, I don't know how the 2fa process is actually knowing how to send an sms message for you.

You need to define exactly where ISmsSender comes from OR if it isn't a stock interface, how to get the UserManager to know about it and work. Otherwise this sample is useless.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

JohnGalt1717 avatar Jun 21 '18 17:06 JohnGalt1717

I'll address this in the next sprint.

Rick-Anderson avatar Jun 21 '18 17:06 Rick-Anderson

Thanks! In the mean time, where does ISmsSender live? I can't find ANYTHING about it anywhere. Yours is literally the only documentation I can find for 2fa in .NET core 2.1.

JohnGalt1717 avatar Jun 21 '18 17:06 JohnGalt1717

Keep in mind we recommend you not use 2FA but rather QR code

ISmsSender is an interface the 2.0 templates generate. It's not in any MS library.

public interface ISmsSender
{
    Task SendSmsAsync(string number, string message);
}

Rick-Anderson avatar Jun 21 '18 18:06 Rick-Anderson

OK, well my question still isn't answered given that I don't want to be using QR codes. How does one register ISmsSender with the SignInManager so it knows how to send the message?

JohnGalt1717 avatar Jun 22 '18 13:06 JohnGalt1717

@JohnGalt1717 Step through the template generated code to see how it works (and the sample).

Rick-Anderson avatar Jun 22 '18 16:06 Rick-Anderson

Thanks for contacting us. We don’t have the resources to invest in this area, so we are closing the issue. Should your request generate enough 👍 responses, we’ll reconsider.

Rick-Anderson avatar Jan 04 '19 00:01 Rick-Anderson

At the very least fix the documentation so that it's obvious that this isn't an interface that's included and define the interface so people know what the heck is going on.

JohnGalt1717 avatar Jan 04 '19 13:01 JohnGalt1717

@JohnGalt1717, I agree with you 100%. Got the same problem too

knitero avatar Jan 06 '19 06:01 knitero

Hey, any progress on that ISmsSender? How to inject this to UserManager?

Bassist067 avatar Apr 16 '19 08:04 Bassist067

@Bassist067 There isn't any such thing. The documentation needs to be fixed to note this and give an example of what ISmsSender should look like and then note that you need to use a 3rd party implementation.

JohnGalt1717 avatar Apr 16 '19 12:04 JohnGalt1717

Surely SMS should have some priority

andrewduffy77 avatar Jul 08 '19 02:07 andrewduffy77

SMS is not secure, that's why we recommend QR code

Rick-Anderson avatar Jul 08 '19 03:07 Rick-Anderson

cheers Rick, so it's not secure if the attacker can get hold of the persons device OR is the vulnerability not dependent on that?

andrewduffy77 avatar Jul 08 '19 03:07 andrewduffy77

SMS is susceptible to SIM Swap attacks

Rick-Anderson avatar Jul 08 '19 03:07 Rick-Anderson

Hi Rick, I'm looking to use 2FA for our customers because we receive their email and phone number from a reliable source (their Mortgage Lender) and although that doesn't mitigate the SIM swap attack vector it does provide us with a convenient way to ensure 2FA is turned on by default. If we can have additional security by default then this raises the bar on security without compromising usability. I would prefer to use time based one time passwords however getting our users to download an additional application to do this does not align with a friction free onboarding path for our users and would require that we don't have 2FA enabled by default.

I guess all I'm really hoping is that you let us know if this is something that is likely to ever see the light of day or is it something that you think will fall out of favour completely and ever be developed/completed as we will have to make alternate plans.

gavinkilbride avatar Jul 10 '19 00:07 gavinkilbride

@gavinkilbride you're still free to use SMS/2FA and like you say it's pretty simple.

Rick-Anderson avatar Jul 10 '19 00:07 Rick-Anderson

@Rick-Anderson so you're saying I can implement a custom 2fa provider in order to achieve SMS 2FA in Microsoft.AspNetCore.Identity 3?

How do I implement / wire that up? I can't find this anywhere?

Cheers

andrewduffy77 avatar Jul 10 '19 08:07 andrewduffy77

@blowdart what's our guidance for SMS 2FA for ASP.NET Core 3.0. @gavinkilbride makes what seems to me a reasonable argument for it (Friction free 2FA).

Rick-Anderson avatar Jul 10 '19 15:07 Rick-Anderson

Out guidance is the same as NIST, no-one should be doing this any more. The previous approach in 2.0 should work, but we're not going to document it.

blowdart avatar Jul 10 '19 15:07 blowdart

Hello, I have been all over the internet trying to implement this SMS 2FA thing, similar to the other requests, I do not want to introduce extra complication on the user part, so QR code is not an option, PLEASE, any information that would guide me on how to implement this would be greatly appreciated. Thanks

kigold avatar Dec 16 '19 11:12 kigold