- Minimum NodeJS 12
- MySQL
- Download and extract this source code in your computer
- Go to extracted directory and run
npm install
to install all package libraries. - Edit the
config.js
- See the
config.js
'use strict'
const config = {
port: process.env.PORT || 3000, // Port Server (default is 3000)
session: {
maxAge: 60000, // 1minute, will automatically update following expires time from SSO access_token
secret: 'secret for session'
},
database: {
name: 'service_db',
user: 'root',
pass: '',
host: 'localhost',
port: 3306,
logging: true
},
sso_url_login: 'http://localhost:4000/login',
sso_url_token: 'http://localhost:4000/token',
sso_url_profile: 'http://localhost:4000/profile',
sso_client_id: '60mwt1txtlnvadtjy5pkwtfwos78im67',
sso_client_secret: 'kxiykbx9b4ibjd1ofhbg6qg3u4hshui22e8zrp0bqdw'
}
module.exports = config
Note:
- Default will use standard host and port of MySQL.
- You have to create new database name with
service_db
(you are able to change this) - Application use default port
3000
- Create table by run
npm run seed
Before running the application make sure you already run npm run seed
for the first time only.
- To start the application, just run
npm start
then open your browser tohttp://localhost:3000
.
-
Callback Url
http://localhost:3000/cb -
Register
Go to SSO Server at http://localhost:4000/register, fill the form and submit, when you have the client_id and client_secret, you have to edit theconfig.js
then restart this server by runnpm start
.
npm test