Identity using Auth0
- Auth0 is the Identity-as-a-Service (IDaaS) used in the stacks demo.
- PassportJS lib is the node middleware to create and manage user authentication sessions.
- Redis DB is used for passport session management.
Implementation
The stacks demo is built using Passport-auth0 strategy. Every successful login will result in a session-cookie created and stored in the browser. The application relies on this cookie to decide if the user is logged in or not.
Environmental variables
npx cross-env \
AUTH0_CLIENT_ID=<AUTH0_CLIENT_ID> \
AUTH0_DOMAIN=<AUTH0_DOMAIN> \
AUTH0_CLIENT_SECRET=<AUTH0_CLIENT_SECRET> \
Redis Cache [Optional]
- Redis is used as a preferred DB to maintain the user state. ioredis is the redis client used due to its robust and performance-focus.
Implementation of Redis Cache
- Download Redis to local machine (Follow instruction here)
- It is a good idea to copy both the Redis server and the command line interface
- Redis-cli is useful tool to query the local redis server
$redis-cli ping
PONG \\response from server
- Kickstart the redis-server
- Verify the server is running before running the application
- Build and start the Yumido application.
Environmental variables for Redis
npx cross-env \
REDIS_HOST=<REDIS_HOST> \
REDIS_PORT=<REDIS_PORT> \
REDIS_ENABLED=true \
Please note Redis is disabled for running in CI