# NodeJS
This module is used for authentication between clients and equeum.com server, currently we are using Okta as the users managements.
Sample usage:
var app = ;var server = ; var MachiAuth = MachiAuth;var machiAuth = ; machiAuth;machiAuth; app;
Options- You can customize the following options
Define the routes:
optionsroutes = login: '/login' logout: '/logout' register: '/register' activateUser: '/activateUser' forgotPassword: '/forgotPassword' resetPassword: '/resetPassword' unauthorized: '/unauthorized'
Define the email options
optionsemails=emailTemplateFolder:'< Set to a new folder to change the default one >'templates: verify: title: 'Confirm your account' view: 'verify-email.html' welcome: title: 'Thanks for signing up' view: 'welcome-email.html' resetPassword: title: 'Reset your Password' view: 'reset-password-email.html' passwordChanged: title: 'Your password has been changed' view: 'password-changed-email.html' changeEmail: title: 'Change Email' view: 'change-email.html' fromEmail:'no-reply@equeum.com'fromEmailTitle:'Equeum'
AccessTokens usage
Request for new AccessToken:
Request api /tokens/requestToken
Use the AccessToken to consume the protected resources:
Include the accessToken in req.headers or req.cookies and you will be authorized