Skip to content

EsupPortail/esup-otp-api

Repository files navigation

esup-otp-api

esup-otp-api is a RESTful api using NodeJS to generate, send and verify one-time codes for [EsupPortail]

Version

1.7.3

Runs on Node v20.11.1 and npm v10.2.4

Requirement

Requires Mongodb

sudo service mongod start

Installation

esup-otp-api runs in http, if you want a secure mode you will need a reverse proxy.

Behind Apache

  • https
RequestHeader set X-Forwarded-Proto https
RequestHeader set X-Forwarded-Port 443

<Location />
ProxyPass http://127.0.0.1:3000/
ProxyPassReverse http://127.0.0.1:3000/
</Location>
  • websocket
RewriteEngine On
RewriteCond %{QUERY_STRING} transport=websocket [NC]
RewriteRule /(.*) ws://127.0.0.1:3000/$1 [P]

Systemd

[Unit]
Description=esup-otp-api nodejs app
Documentation=https://github.com/EsupPortail/esup-otp-api
After=network.target

[Service]
Type=simple
User=esup
WorkingDirectory=/opt/esup-otp-api
ExecStart=/usr/bin/node run
Restart=on-failure

[Install]
WantedBy=multi-user.target

Tests

npm test

See also

License

MIT [EsupPortail]: https://www.esup-portail.org/