{"repo":"vapor/authentication","free":true,"listed":false,"github":"https://github.com/vapor/authentication","clone":"git clone https://github.com/vapor/authentication.git","description":"👤 Lightweight authentication framework for Swift","language":"Swift","stars":62,"topics":["authentication","authorization","fluent","vapor","vapor-service","swift-linux","server-side-swift"],"license":"MIT","category":"auth-billing-email","readme_excerpt":"A lightweight authentication library for Swift providing common authentication operations, such as password hashing and OTP verification and generation. Installation Add the Authentication package to your Package.swift dependencies: Then add Authentication to your target's dependencies: Password Hashing Securely hash and verify user passwords using the bcrypt algorithm, the PasswordHasher protocol or the PBKDF2 algorithm: Configuration Bcrypt The cost parameter controls how computationally expensive the hashing operation is. Higher costs provide more security but take longer to compute: Note : Increasing the cost by 1 doubles the computation time. A cost of 12 takes approximately 250ms on modern hardware. PBKDF2 In PBKDF2 you can configure the number of iterations and hashing function. There are sensible standards in place already depending on the hash algorithm used, so only adjust the iterations if necessary: One-Time Passwords (OTP) Generate RFC-compliant HOTP and TOTP codes for multi-factor authentication. Time-Based One-Time Passwords (TOTP) TOTP generates codes that change at regular intervals (typically 30 seconds): Hash-Based One-Time Passwords (HOTP) HOTP generates codes based on a counter value: Configuring OTP Parameters Both HOTP and TOTP support configuration options: Verifying Codes with Range Tolerance To account for clock drift or user delays, generate multiple codes within a range:","default_branch":null,"files":null,"tree":[],"storefront":"/r/vapor","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/vapor/authentication/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."}