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.
- copy this repo to your remote server and install docker
- (optional) install "letsencrypt" SSL certificates for a secure connection
- create a new .env file (based on
.env.example
) and fill the values accordingly - generate a random salt:
openssl rand -hex 32
& save it to your.env
- update the
EXPOSE
value in yourDockerfile
- build the docker container with
docker build -t otp-auth .
- 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)
- install the
Scriptable
app from the App Store - for each of the
*.js
files in theclient/
folder: create a new script in theScriptable
app - replace the default SALT in the
run.js
file with the previously generated value - open the
otp-auth-client.shortcut
file with theShortcuts
app and install the workflow - select the
gen-otp-token.js
script in the first action of the workflow - enter the domain of your server and the port the service is running on in action 4
- execute the shortcut -> you should receive a success message from your server
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.