{"repo":"jiripudil/otp","free":true,"listed":false,"github":"https://github.com/jiripudil/otp","clone":"git clone https://github.com/jiripudil/otp.git","description":"PHP library that generates and verifies one-time passwords.","language":"PHP","stars":29,"topics":["authentication","hotp","otp","php","totp","hacktoberfest"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"One-Time Passwords in PHP OTP is a library that generates and verifies One-Time Passwords conforming to the HOTP (RFC 4226) and TOTP (RFC 6238) algorithms. These one-time passwords are commonly used as a second factor during user authentication. In short, your application and the user's OTP application are both able to generate a number based on a shared secret. Whenever you need to authenticate the user, ask them to enter the code generated by their application and verify it with this library. Installation and requirements OTP requires PHP = 8.2. Usage The entrypoint of this library is the JiriPudil\\OTP\\OTP class: It expects you to provide: 1. The $issuer name. This is often used by the end-user applications to distinguish OTPs for various services, and should thus clearly identify your application. 2. An $otp type. This library provides implementations for both HOTP and TOTP. See below for details. 3. The hashing $algorithm . This is optional and defaults to SHA-1. ⚠ Please be aware that some end-user implementations such as Google Authenticator only support this algorithm. Time-based OTP The JiriPudil\\OTP\\TimeBasedOtp class implements the TOTP according to RFC 6238 and it is perhaps the most commonly used type of OTPs. It generates a code in a fixed-time interval. The constructor expects you to provide an implementation of Psr\\Clock\\ClockInterface . Using time-based OTPs requires the clocks on your server and in the user's application to be in sync. To compensate for the p","default_branch":null,"files":null,"tree":[],"storefront":"/r/jiripudil","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/jiripudil/otp/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}