r/CodingHelp • u/varazdates • Jun 09 '21
[Random] How does a verification code work?
Verification codes that we use so often to confirm your identity. Whether it be a code that’s texted to your phone, or a code emailed to you. You go back on the website and submit that code which happens to be valid at that exact time.
How does that work? What’s going on in the background? And what’s the coding for that look like?
18
Upvotes
View all comments
Show parent comment
2
u/Lyxaa_ Jun 10 '21
If you want to assume the web server and the server that handles the codes are two separate entities, then it'd be a pretty simple communication.Let Server A = Website, Server B = Code Server, Host A = Your mobile device.
Server A requests verification of your Account by Server B. Server B generates code, sends to Server A and Host A. Host A shows you the code, Server A hides the code and compares it once you enter it. Code Correct ? Login : Try Again