GithubHelp home page GithubHelp logo

snw7 / otp-auth Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 38 KB

This is a lightweight API that allows communication between iOS devices and a remote server. It relies on OTP authentication.

License: MIT License

Dockerfile 1.72% Python 9.77% JavaScript 88.51%
api docker otp shortcuts

otp-auth's Introduction

Documentation

This is a lightweight API that allows communication between iOS devices and a remote server. The API endpoint is containerized with docker. It relies on OTP authentication. Each token is valid for 30s.

Setup

Server

  1. copy this repo to your remote server and install docker
  2. (optional) install "letsencrypt" SSL certificates for a secure connection
  3. create a new .env file (based on .env.example) and fill the values accordingly
  4. generate a random salt: openssl rand -hex 32 & save it to your .env
  5. update the EXPOSE value in your Dockerfile
  6. build the docker container with docker build -t otp-auth .
  7. run the docker container docker run -d -p <your-port>:<your-port> -v /etc/letsencrypt/:/etc/letsencrypt/ otp-auth (volume mount is only required for SSL setup)

Client

  1. install the Scriptable app from the App Store
  2. for each of the *.js files in the client/ folder: create a new script in the Scriptable app
  3. replace the default SALT in the run.js file with the previously generated value
  4. open the otp-auth-client.shortcut file with the Shortcuts app and install the workflow
  5. select the gen-otp-token.js script in the first action of the workflow
  6. enter the domain of your server and the port the service is running on in action 4
  7. execute the shortcut -> you should receive a success message from your server

License

This project is written by snw7 and licensed under the MIT License.

This project uses https://github.com/emn178/js-sha3 © Chen, Yi-Cyuan 2015-2018.

otp-auth's People

Contributors

snw7 avatar

Stargazers

 avatar

Watchers

 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.