Skip to content

Latest commit

 

History

History
84 lines (62 loc) · 2.24 KB

File metadata and controls

84 lines (62 loc) · 2.24 KB

Example of Custom Client Registration Authentication

Overview

The purpose of this example is to demonstrate following features of NVFlare,

  1. Run NVFlare in secure mode
  2. Demonstrate custom authentication policy

During the client registering to the server process, customer can build an event handler to listen to the EventType.CLIENT_REGISTERED event, and inject additional logic to verify and process the client registration. If a particular client does not meet certain criteria, the server can reject the client registration.

System Requirements

1. Install Python and Virtual Environment,

python3 -m venv nvflare-env
source nvflare-env/bin/activate

2. Install NVFlare

pip install nvflare

3. The example is part of the NVFlare source code. The source code can be obtained like this,

git clone https://github.com/NVIDIA/NVFlare.git

4. TLS requires domain names. Please add following line in /etc/hosts file,

127.0.0.1   server1

Setup

::
cd NVFlare/examples/advanced/custom_authentication ./setup.sh

All the startup kits will be generated in this folder,

/tmp/nvflare/poc/custom_authentication/prod_00

Note

workspace folder is removed everytime setup.sh is run. Please do not save customized files in this folder.

Starting NVFlare

This script will start up the server and 2 clients,

nvflare poc start

Logging with Admin Console

For example, this is how to login as [email protected] user,

cd /tmp/nvflare/poc/custom_authentication/prod_00/[email protected]
./startup/fl_admin.sh

At the prompt, enter the user email [email protected]

Start the server

cd /tmp/nvflare/poc/custom_authentication/prod_00/server1 ./startup/start.sh

Participants

Site_a

cd /tmp/nvflare/poc/custom_authentication/prod_00/site_a ./startup/start.sh
  • site_a is able to start and register to the server.

Site_b

cd /tmp/nvflare/poc/custom_authentication/prod_00/site_a ./startup/start.sh
  • site_b is NOT able to start and register to the server. It's blocked by the ServerCustomSecurityHandler logic during the client registration.