aalfiann / smj-service

SSO Service

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SMJ-SERVICE

Build Status Coverage Status

Detail Installation

Requirement

  1. Minimum NodeJS 12
  2. MySQL

1. Setup Application

  1. Download and extract this source code in your computer
  2. Go to extracted directory and run npm install to install all package libraries.
  3. Edit the config.js

2. Configuration

  1. 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

3. Setup Database

  1. Create table by run npm run seed

4. Run Application

Before running the application make sure you already run npm run seed for the first time only.

  1. To start the application, just run npm start then open your browser to http://localhost:3000.

5. Integration with SSO Server

Unit Test

npm test

About

SSO Service


Languages

Language:JavaScript 100.0%