Coder Social home page Coder Social logo

bigardone / passwordless-auth Goto Github PK

View Code? Open in Web Editor NEW
43.0 3.0 3.0 252 KB

Sample project of password-less & database-less socket authentication with Elixir, Phoenix and Elm.

Elixir 48.76% HTML 0.79% JavaScript 31.27% CSS 1.89% Elm 17.30%
elixir-lang phoenix-framework elm-lang password-less-authentication databaseless

passwordless-auth's Introduction

PasswordlessAuth

This is the demo project for a new series I'll be writing on how to authenticate Phoenix socket connections with a password-less and database-less approach, inspired by Slack's magic link authentication.

Scenario

Have you ever found yourself adding HTTP basic authentication to a small admin panel of some sort? Have you ended up changing it for something way more complicated? How many times did this change leave you with a feeling of unnecessary over-engineering? This small experiment relies on OTP, Phoenix Token, and email sending, to build up a secure and straightforward authentication system for a Phoenix socket connection, used by a small Elm SPA application.

Why password-less and database-less?

Because, why not? I wanted it to be as simple as possible, taking advantage of some of the features which make Elixir and Phoenix so awesome.

Tutorial

  1. Project setup and the initial functionality for storing and verifying authentication tokens
  2. Sending authentication link emails and the user socket connection
  3. Setting up webpack as our asset bundler and the Elm single-page application

Running the project

To start your Phoenix server:

  • Install dependencies with mix deps.get
  • Install Elm dependencies with cd apps/passwordless_auth_web/assets/elm && elm package install
  • Install Node.js dependencies with cd apps/passwordless_auth_web/assets && npm install
  • Start Phoenix endpoint with mix phx.server

Now you can visit localhost:4000 from your browser.

Final result

Final result

Beautiful icons by https://icons8.com

passwordless-auth's People

Contributors

bigardone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.