Authentication

wrannaman
SugarKubes
Published in
2 min readOct 21, 2019
SugarKubes Passwordless Authentication

Authentication is an annoying but integral part of every application. It’s often the first material interaction someone has with a brand. And generally, that process sucks. Why are people still asking for usernames? If you feel the same way then this microservice may be perfect for your next project.

Introducing our newest microservice: Passwordless Authentication.

It’s a simple passwordless authentication module that will work with several different databases including:

- MariaDB
- MySQL
- PostgreSQL
- MSSQL
- SQLite

It is a simple REST api with two main methods. one to get a code, and one to verify the code. You get email validation right out of the box and can even customize the email you send to the user that just signed up.

Default login email

It’s a simple 4 digit code that is good for one time usage. You’re able to configure how long the JWT lasts for as well as which domains are allowed to call the api.

Once, authenticated, you can decode your jwt in your own application. Here’s some sample *NodeJS* code to decode the JWT

const fs = require(‘fs’);
const path = require(‘path’);
const jwt = require(‘jsonwebtoken’);
const publicKey = fs.readFileSync(path.join(__dirname, ‘../../certs/public.key’));
// valid will contain the decoded, verified jwt
const valid = jwt.verify(token.replace(/\n$/, ‘’), publicKey);

And you’re on your way. No more passwords, no more usernames, no more signup friction!

Take a look on SugarKubes for more info

--

--