It's not enough to say trigger a resend with just a phoneNumber and personId, since this would let users spam-text each other.
Perhaps in order to trigger a resend, the client also needs to send along the ID of a valid 2FA code. When a user logs in, the auth µService checks to see if they have 2FA enabled and then makes a grpc request to the mfa service. The mfa service sends a SMS and returns a grpc response containing the uuid PK of the created 2FA code. The client now has proof that they successfully authenticated and triggered the transmission of the first 2FA code; so we can safely let them trigger resends, as long as they provide the uuid code.
There's not a good RESTful way to that is there? http POST /mfa code=$uuid
It's not enough to say trigger a resend with just a
phoneNumber
andpersonId
, since this would let users spam-text each other.Perhaps in order to trigger a resend, the client also needs to send along the ID of a valid 2FA code. When a user logs in, the
auth
µService checks to see if they have 2FA enabled and then makes a grpc request to themfa
service. Themfa
service sends a SMS and returns a grpc response containing the uuid PK of the created 2FA code. The client now has proof that they successfully authenticated and triggered the transmission of the first 2FA code; so we can safely let them trigger resends, as long as they provide the uuid code.There's not a good RESTful way to that is there?
http POST /mfa code=$uuid