Skip to content

OronNadiv/authentication-api

Repository files navigation

Home Automation - Authentication API

Back-end server that handles authentications and permissions. Main functions are:

  • It issues JWT (Javascript Web Token) to other back-end servers, UI and raspberry pi clients.
  • It allows creation of new users, enabling/disabling access, changing permissions and more.

JavaScript Style Guide Dependencies DevDependencies

I suggest you first read about the different components of the home automation application.
This will help you understand better the general architecture and different functions of the system.

Installation instructions

Click here and follow the installation instructions for the server micro-service, before moving to the next step.

Environment variables (configuration)

AUTH_PRIVATE_KEY (required): Generated private key. Public key should be shared with the authentication server. See here.
AUTH_PUBLIC_KEY (required): content of auth server's publickey.
COOKIES_APITOKEN_DOMAIN (required): Your website url. Example my-domain.com
DATABASE_URL (required): url to postgres database. Default: postgres://postgres:@localhost/home_automation
NODE_ENV (required): set up the running environment. Default: production. production will enforce encryption using SSL and other security mechanisms.
PORT (required): server's port. default: 3001
POSTGRESPOOLMIN (required): postgres pool minimum size. Default: 2
POSTGRESPOOLMAX (required): postgres pool maximum size. Default: 10
POSTGRESPOOLLOG (required): postgres pool log. Values: true/false. Default: true
SESSION_SECRET (required): Secret to use in order to encrypt the session cookie data. Default: if NODE_ENV = production => none, otherwise: This is session secret
TOKEN_EXPIRES_IN_MINUTES (optional): // default: 5.
MAX_FAILED_LOGIN_ATTEMPTS (optional): // default: 10.
UI_URL (required): url to the UI server. Default: if NODE_ENV = production => none, otherwise: http://localhost:3000

License

AGPL-3.0

Author

Oron Nadiv ([email protected])

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages