This article is a mirror article of machine translation, please click here to jump to the original article.

View: 11861|Reply: 1

[Angular] Angular 9 series (XII) generates dynamic tokens based on OTPs

[Copy link]
Posted on 7/24/2020 5:52:09 PM | | | |
Angular 9 Series (1) Dynamically Loaded Components
https://www.itsvse.com/thread-9238-1-1.html

Angular 9 series (2) dynamic component transmission parameters
https://www.itsvse.com/thread-9245-1-1.html

Angular 9 series (3) subscribes to dynamic component events
https://www.itsvse.com/thread-9246-1-1.html

Angular 9 Series (IV) Custom Pipe pipelines
https://www.itsvse.com/thread-9248-1-1.html

Angular 9 Series (V) formats the amount currency format
https://www.itsvse.com/thread-9249-1-1.html

Angular 9 series (VI) calls native JS variables and methods
https://www.itsvse.com/thread-9254-1-1.html

Angular 9 series (VII) CSS-style scope
https://www.itsvse.com/thread-9264-1-1.html

Angular 9 series (VIII) updates the value of a child component by triggering an event via set
https://www.itsvse.com/thread-9267-1-1.html

Angular 9 Series (nine) #id selector applied on the page
https://www.itsvse.com/thread-9278-1-1.html

Angular 9 series (10) embeds vconsole and eruda developer debugging panels
https://www.itsvse.com/thread-9286-1-1.html

Angular 9 Series (XI) 5 Ways to Define Styles
https://www.itsvse.com/thread-9305-1-1.html

Introduction: OTP generally refers to one-time passwords. One Time Password (OTP), also known as "one-time password", refers to a password that can only be used once. The one-time password is based on a special algorithm that generates an unpredictable combination of random numbers every 60 seconds, and the iKEY one-time password has been widely used in finance, telecommunications, online games and other fields, effectively protecting the security of users.

Common applications include: Google authenticator, QQ token, etc.

Let's take a look at the renderings first, as shown below:


.NET/C# generates one-time passwords based on TOTP
https://www.itsvse.com/thread-9327-1-1.html

First, create an otp-one-time-password-demo project using angular-cli with the following command:



Install the OTP plugin, which is the plugin for the encryption algorithm, and the code is as follows:



The progress bar was written by me with reference to ng-simple-progress-bar, because his plugin cannot set the progress manually.

progress-bar.component.html



progress-bar.component.scss



progress-bar.component.ts



The following is mainly our main interface and the code to generate dynamic passwords.

app.component.html



app.component.scss



app.component.ts


Finally, attach the source code download address:

Tourists, if you want to see the hidden content of this post, pleaseReply





Previous:Discuz performs a series of registration operations
Next:Dynamic token OTP, TOTP, and HOTP difference
 Landlord| Posted on 7/25/2020 4:16:15 PM |
There is a problem with the password generated by this plugin in sha256, it is recommended to use OTPAuth, the code is as follows:


The test is correct in both SHA256 and SHA512 modes.

Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com