Overview

Finally, the time has reached where we don’t need to share the passwords rather a service like OAuth2 can be used to authenticate which is based on token.

For more details about OAuth2, view https://www.oauth.com

Installation

  1. Install a VM e.g. VirtualBox on your system with configurations: Hard disk 10 GB, RAM 8 GB
  2. Use image ubuntu-18.04.3-live-server-amd64
  3. Install docker community edition using the link https://docs.docker.com/install/linux/docker-ce/ubuntu/
  4. Use the following command to run and configure OAuth2 Server
    • docker run –rm -d –name oauth-server -p 8080:8080 harbois/oauth-server:beta (run the server at port 8080 which is exposed at Ubunto OS level)

    • curl http://localhost:8080 (Check if the server is running)
  5. In the VM e.g. VirtualBox, expose the ports so that you can access and run the OAuth2 Server in your local browser
    • Machine -> Settings -> Network -> Advanced -> Port Forwarding (location)
    • Name: harbiosauth2server Host Port: 9090, Guest Port: 8080
  6. Type in the following command in your local browser (Google Chrome) to login
    • http://localhost:9090
    • User: admin
    • Password: 123456