Oslo provides auth building blocks: password hashing, TOTP, OAuth, JWTs. From the Lucia Auth creator.
Password Hashing
import { Argon2id } from "oslo/password";
const argon2id = new Argon2id();
const hash = await argon2id.hash("password123");
const valid = await argon2id.verify(hash, "password123");
TOTP (2FA)
import { TOTPController, createTOTPKeyURI } from "oslo/otp";
const totp = new TOTPController();
const code = await totp.generate(secret);
const valid = await totp.verify(code, secret);
OAuth 2.0
import { OAuth2Client } from "oslo/oauth2";
const client = new OAuth2Client(clientId, authEndpoint, tokenEndpoint);
const url = await client.createAuthorizationURL({ state, scopes: ["email"] });
Key Features
- Argon2/Bcrypt/Scrypt hashing
- TOTP/HOTP for 2FA
- OAuth 2.0 client
- JWT utilities
Need to scrape or monitor web data at scale? Check out my web scraping actors on Apify or email spinov001@gmail.com for custom solutions.
Top comments (0)