LIGHT

  • News
  • Docs
  • Community
  • Reddit
  • GitHub
Star

User Management Portal

User management is the hybrid service in light-portal which used for portal user management. It provides the following services:

– Register New User

– Active User (By click the link in the email to entry the link from browser)

– Change User contact information

– Change User email address (will send email to confirm email change)

– Change User login Id

– Delete User

– Login User (integrate with light-oauth2 service to get user token and integrate with light-session for session management)

– Get User detail by Id

– Get User detail by email

– Get User detail by login Id

– Get All Active User (admin role)

User management Hybrid service is entry point for light-portal. After user Register User and login to the portal, user can start to use the ALL portal services which include Host-Menu, Schema-Form, Light-Oauth…

Build services

Build user-management project in the light-portal.

cd ~/networknt/light-portal/user-management
mvn clean install

Setting and running hybrid-service

Build light-portal common-util and hybrid-command, hybrid-query service

cd ~/networknt/light-portal/
mvn clean install

Now let’s copy the user-management service jar and lib jar files to the service folder for the hybrid-command in light-config-test.

cd ~/networknt/light-config-test/light-portal/hybrid-command/service
cp ~/networknt/light-portal/user-management/auth/target/usermanagement-auth-0.1.0.jar .
cp ~/networknt/light-portal/user-management/common/target/user-management-common-0.1.0.jar .
cp ~/networknt/light-portal/user-management/jdbc/target/usermanagement-jdbc-0.1.0.jar .
cp ~/networknt/light-portal/user-management/hybrid-service/target/user-hybrid-service-0.1.0.jar .

Use the following command to start the server.

cd ~/networknt/light-config-test/light-portal/hybrid-command/cloud
java -Dlight-4j-config-dir=./config -Dlogback.configurationFile=./logback.xml -cp ~/networknt/light-portal/hybrid-command/target/hybrid-command-1.5.11.jar:../service/* com.networknt.server.Server

Verify (with sample curl url)

– Create New User

curl -X POST \
  https://localhost:8443/api/json \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d ' {"host":"lightapi.net","service":"user","action":"createUser","version":"0.1.0","data":{"host":"networknt.com","screenName":"testUser","password":"1222222","contactData":{"email":"[email protected]","addresses":[{"country":"CA","state":"AK","city":"BaBa","addressLine1":"222 Bay Street","addressType":"SHIPPING"}],"gender":"MALE"}}}
'

After user is created, the user should get an email from ‘lightapi.net’, to active the user.

The user can click the link or get the url from the link and manually input into browser to active user.


Welcome to Light-portal!

To complete your account registration, please confirm your email address by clicking on the following link:

Click <link> to activate your account.

If you cannot click on the link above, please copy and paste it into your web browser.
Please visit https://github.com/networknt/light-portal for more information.

– Update User

curl -X POST \
  https://localhost:8443/api/json \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d ' {"host":"lightapi.net","service":"user","action":"updateUser","version":"0.1.0","data":{"id":"222-111", "host":"networknt.com","screenName":"testUser","password":"1222222","contactData":{"email":"[email protected]","addresses":[{"country":"CA","state":"AK","city":"BaBa","addressLine1":"222 Bay Street","addressType":"SHIPPING"}],"gender":"MALE"}}}
'

— DeleteUserById

curl -X POST \
  https://localhost:8443/api/json \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{"host":"lightapi.net","service":"user","action":"deleteUserById","version":"0.1.0","data":{"id":"111222-2222"}}'

– Login User

curl -X POST \
  https://localhost:8443/api/json \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{"host":"lightapi.net","service":"user","action":"loginUser","version":"0.1.0","data":{"nameOrEmail":"testUser", "password": "1222222"}}'

– Get Users (Admin role only)

curl -X POST \
  https://localhost:8443/api/json \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{"host":"lightapi.net","service":"user","action":"getUsers","version":"0.1.0"}'

— GetUserByEmail:

curl -X POST \
  https://localhost:8443/api/json \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{"host":"lightapi.net","service":"user","action":"getUserByEmail","version":"0.1.0","data":{"email":"[email protected]"}}'

— GetUserByName

curl -X POST \
  https://localhost:8443/api/json \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{"host":"lightapi.net","service":"user","action":"getUserByName","version":"0.1.0","data":{"name":"testUser"}}'
  • About Light
    • Overview
    • Testimonials
    • What is Light
    • Features
    • Principles
    • Benefits
    • Roadmap
    • Community
    • Articles
    • Videos
    • License
    • Why Light Platform
  • Getting Started
    • Get Started Overview
    • Environment
    • Light Codegen Tool
    • Light Rest 4j
    • Light Tram 4j
    • Light Graphql 4j
    • Light Hybrid 4j
    • Light Eventuate 4j
    • Light Oauth2
    • Light Portal Service
    • Light Proxy Server
    • Light Router Server
    • Light Config Server
    • Light Saga 4j
    • Light Session 4j
    • Webserver
    • Websocket
    • Spring Boot Servlet
  • Architecture
    • Architecture Overview
    • API Category
    • API Gateway
    • Architecture Patterns
    • CQRS
    • Eco System
    • Event Sourcing
    • Fail Fast vs Fail Slow
    • Integration Patterns
    • JavaEE declining
    • Key Distribution
    • Microservices Architecture
    • Microservices Monitoring
    • Microservices Security
    • Microservices Traceability
    • Modular Monolith
    • Platform Ecosystem
    • Plugin Architecture
    • Scalability and Performance
    • Serverless
    • Service Collaboration
    • Service Mesh
    • SOA
    • Spring is bloated
    • Stages of API Adoption
    • Transaction Management
    • Microservices Cross-cutting Concerns Options
    • Service Mesh Plus
    • Service Discovery
  • Design
    • Design Overview
    • Design First vs Code First
    • Desgin Pattern
    • Service Evolution
    • Consumer Contract and Consumer Driven Contract
    • Handling Partial Failure
    • Idempotency
    • Server Life Cycle
    • Environment Segregation
    • Database
    • Decomposition Patterns
    • Http2
    • Test Driven
    • Multi-Tenancy
    • Why check token expiration
    • WebServices to Microservices
  • Cross-Cutting Concerns
    • Concerns Overview
  • API Styles
    • Light-4j for absolute performance
    • Style Overview
    • Distributed session on IMDG
    • Hybrid Serverless Modularized Monolithic
    • Kafka - Event Sourcing and CQRS
    • REST - Representational state transfer
    • Web Server with Light
    • Websocket with Light
    • Spring Boot Integration
    • Single Page Application
    • GraphQL - A query language for your API
    • Light IBM MQ
    • Light AWS Lambda
    • Chaos Monkey
  • Infrastructure Services
    • Service Overview
    • Light Proxy
    • Light Mesh
    • Light Router
    • Light Portal
    • Messaging Infrastructure
    • Centralized Logging
    • COVID-19
    • Light OAuth2
    • Metrics and Alerts
    • Config Server
    • Tokenization
    • Light Controller
  • Tool Chain
    • Tool Chain Overview
  • Utility Library
  • Service Consumer
    • Service Consumer
  • Development
    • Development Overview
  • Deployment
    • Deployment Overview
    • Frontend Backend
    • Linux Service
    • Windows Service
    • Install Eventuate on Windows
    • Secure API
    • Client vs light-router
    • Memory Limit
    • Deploy to Kubernetes
  • Benchmark
    • Benchmark Overview
  • Tutorial
    • Tutorial Overview
  • Troubleshooting
    • Troubleshoot
  • FAQ
    • FAQ Overview
  • Milestones
  • Contribute
    • Contribute to Light
    • Development
    • Documentation
    • Example
    • Tutorial
“User Management Portal” was last updated: September 28, 2021: updates (a1608d1)
Improve this page
  • News
  • Docs
  • Community
  • Reddit
  • GitHub
  • About Light
  • Getting Started
  • Architecture
  • Design
  • Cross-Cutting Concerns
  • API Styles
  • Infrastructure Services
  • Tool Chain
  • Utility Library
  • Service Consumer
  • Development
  • Deployment
  • Benchmark
  • Tutorial
  • Troubleshooting
  • FAQ
  • Milestones
  • Contribute