Skip to content

jenhao-thesis/LdapDapp

Repository files navigation


Blockchain-based Identification and Access Control Framework - A Case Study of Open Banking Ecosystem
Explore the full thesis »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Contact

About The Project

Dapp-screenshot

In this thesis, we propose blockchain-based identification and access control framework for Open Banking ecosystem. This framework allows organization administrators to interact with Ethereum nodes for register the digital identity of the customer, and customers also can manage their digital identity and control their data access by calling smart contract functions directly.

In addition, we develop a decentralized application (DApp) to provide the interface for customers to integrate their identities and control data access rights. The DApp we developed has the following features:

  • It supports blockchain-based third-party login.
  • It provides the Web interface to conduct identity integration processes for customers.
  • It enables banks or third-party service providers (TSP) to offer more diverse services and strengthen data sharing.
  • It establishes a transparent blockchain environment as well as clear workflows.

As shown in the following figure, the DApp represents applications developed by organizations or TSPs.

system_architecture

Built With

Getting Started

Before getting started, you should build the blockchain environment (e.g., Ethereum nodes) and setup the LDAP server.

Prerequisites

  • node

    apt install nodejs
    node -v
  • npm

    apt install npm
    npm -v
  • truffle

    npm install -g truffle
  • (optional) Remix If you don't have truffle toolkit, you also can compile your contract code by online IDE, e.g., Remix.

  • Redis

    apt-get install redis-server

    Next is to enable Redis to start on system boot. Also restart Redis service once.

    sudo systemctl enable redis-server.service
  • (optional) browserify If you don't use web3 provided by browser (older version), you should install browserify for compile packages. The Browserify lets you use require in the browser, the same way you'd use it in Node​.

    npm install -g browserify

Installation

  1. Clone the repo

    git clone https://github.com/jenhao-thesis/LdapDapp.git
  2. Install NPM packages

    npm install
  3. Compile smart contract code

    truffle init
    truffle compile
    truffle migrate --reset

    After compiling contracts, you will get build folder including contract .json files. And copy the contract address (OMgr) after migration complete. PS. If it is failed, just update the node version to 14.15.1.

  4. Setup configuration (server-config.json)

    cp server-config-example.json server-config.json

    For example:

    {
        "ldap": {
            "server": {
                "url": "ldap://[ip:port]",
                "bindDN": "[bindDN]",
                "bindCredentials": "[bindCredentials]",
                "searchBase": "[searchBase]",
                "searchFilter": "[searchFilter]"
            },
            "usernameField": "username",
            "passwordField": "password"
        },
        "redis": {
            "host": "[ip]",
            "port": "[port]"
        },
        "contracts": {
            "organizationManagerAddress": "[contract address]",
            "accessManagerAddress": ""
        },
        "admin_address": "[administrator address]",
        "admin_key": "[administrator private key]",
        "web3_provider": "ws://[ip:port]",
        "org_mapping": {
            "[address of organization A(upper case only)]": ["[ip:port]", "[organization name for display on website]"],
            "[address of organization B(upper case only)]": ["[ip:port]", "[organization name for display on website]"],
            "[address of organization C(upper case only)]": ["[ip:port]", "[organization name for display on website]"],
            "[address of organization D(upper case only)]": ["[ip:port]", "[organization name for display on website]"],
            "[address of organization E(upper case only)]": ["[ip:port]", "[organization name for display on website]"]
        }
    }
  5. Enter your the contract address (OMgr) in server-config.json.

  6. (optional) Convert web3_init.js to web3_bundle.js

    browserify web3_init.js -o web3_bundle.js
  7. Launch Dapp.

    npm start

Docker

In addition to installation the complete project, we also write a docker-compose file that builds and runs multi-container Docker applications. With it, we can easier create, deploy, and run our all applications by using containers.

When we build and run 3 organizations follows five steps.

  1. Create directorys for 3 organizations.

    mkdir orgA
    mkdir orgB
    mkdir orgC
  2. Clone two repos in each directory separately.

    git clone https://github.com/jenhao-thesis/LdapDapp.git
    git clone https://github.com/jenhao-thesis/LdapServer.git
  3. Copy docker-compose.yml from LdapDapp folder.

    cp orgA/LDapp/docker-compose.yml orgA/
    cp orgB/LDapp/docker-compose.yml orgB/
    cp orgC/LDapp/docker-compose.yml orgC/
  4. Setup server-config.json in each directory separately.

  5. Start all Docker Containers in each directory separately.

    cd orgA/
    docker-compose up -d
    
    cd orgB/
    docker-compose up -d
    
    cd orgC/
    docker-compose up -d    

Multiple organizations folder structure

.
├── orgA
│   ├── docker-compose.yml
│   ├── LdapDapp                    # git clone https://github.com/jenhao-thesis/LdapDapp.git
│   │   ├── server-config.json      # Server configuration
│   │   ├── build                   # 1) truffle compile, generate contracts json file. or 2) compile contracts via Remix
│   │   │   └── contracts
│   │   │       ├── AccessManager.json
│   │   │       └── OrganizationManager.json
|   |   └── ...
│   └── LdapServer                  # git clone from https://github.com/jenhao-thesis/LdapServer.git
├── orgB
└── orgC

PS. server-config.json should be set hostname as follows.

"host": "redis",
"web3_provider": "ws://ganache:8545",
"url": "ldap://ldap_server:1389",

Usage

The following figure demonstrates how the DApp can be used.

usage-flow

Contact

Jen-Hao Cheng - [email protected], [email protected]

About

Blockchain-based Identification and Access Control for OpenBanking Ecosystem

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages