C#C
C#3y ago
no >> body

❔ ASP.NET Core Identity OTP creation date

So, currently, I have an authentication server (not with IdentityServer4/Duende).
I have enabled two-factor authentication, and I want users to be able to send sms with otp only once per 60 seconds.

From what I see, there is no information in AspNetUserTokens about the date it was generated.

So I have an idea to expand this table with an additional column with a time stamp, so I can track when otp was created and prevent user from sending a new one if it was created recently.
I've added a new migration and recreated a database, and now table AspNetUserTokens contains a new row which indicates creation date.

Now I'm trying to figure out how to make Identity use my new class with a Created property.

I'm also wondering if I'm in a right direction or it should be implemented in the different way.

Would be glad to hear any ideas/advices.
Was this page helpful?