Authentication
Introduction
Authentication is required to access protected portions of the application. Dynamo makes use of JSON Web Tokens (JWT) to provide stateless authentication.
Sign Up
Creating new users can either be done from the Manager Users module of the Dynamo developer interface (Dynamo-admin) or by calling the register function on Infrastructure
/**
+ Registers a new user
+ @param {Object} user UserInfo, which includes username ,password and role
+ @param {Function} fn callback
+ @return {Object} Created User.
*/
this.entityRepo.infrastructure().register(user, fn);
Login
User login is done by hitting the endpoint `https://DYNAMO_WEB_SERVER/auth/token`
with the username, password and appropriate domain information just as the following curl command -
curl --location --request POST "https://DYNAMO_WEB_SERVER/auth/token" \
--header "Content-Type: application/json" \
--data "{
\"username\": \"test_user\",
\"password\": \"password\"
}"
Login can also be performed directly from processor code by calling the login method on Infrastructure.