vantage6
CHECK OUT OUR NEW DOCUMENTATION
3 | Petronas
3 | Petronas
  • Welcome
  • Background
    • Architecture
    • Partners
    • Release notes
    • How to contribute
  • Install
    • Requirements
      • 🐍Python
      • 🐳Docker
    • Client
    • Node
    • Server
      • User Interface
      • EduVPN
      • RabbitMQ
      • Docker registry
  • Use
    • Preliminaries
    • Client
      • User Interface
      • Python client
        • Authentication
        • Creating an organization
        • Creating a collaboration
        • Registering a node
        • Creating a task
      • R Client
      • Server API
    • Node
      • Configure
      • Security
      • Logging
    • Server
      • Configure
      • Batch import
      • Shell
      • Deployment
      • Logging
  • Algorithms
    • Concepts
      • Input & output
      • Wrappers
      • Mock client
      • Child containers
      • Networking
      • Cross language
      • Package & distribute
    • Tutorial
      • Introduction
    • Classic Tutorial
  • References
    • Glossary
Powered by GitBook

This documentation space is no longer maintained. For the latest documentation please refer to https://docs.vantage6.ai

On this page

Was this helpful?

Edit on GitHub
Export as PDF
  1. Use
  2. Client
  3. Python client

Authentication

How to authenticate a client with the vantage6 server

PreviousPython clientNextCreating an organization

Last updated 2 years ago

Was this helpful?

This page and the following pages introduce some minimal examples for administrative tasks that you can perform with our . We start by authenticating.

To authenticate, we create a config file to store our login information. We do this so we do not have to define the server_url, server_port and so on every time we want to use the client. Moreover, it enables us to separate the sensitive information (login details, organization key) that you do not want to make publicly available, from other parts of the code you might write later (e.g. on submitting particular tasks) that you might want to share publicly.

# config.py

server_url = "https://MY VANTAGE6 SERVER" # e.g. https://petronas.vantage6.ai or 
                                          # http://localhost for a local dev server
server_port = 443 # This is specified when you first created the server
server_api = "" # This is specified when you first created the server

username = "MY USERNAME"
password = "MY PASSWORD"

organization_key = "FILEPATH TO MY PRIVATE KEY" # This can be empty if you do not want to set up encryption

Note that the organization_key should be a filepath that points to the private key that was generated when the organization to which your login belongs was first created (see ).

Then, we connect to the vantage 6 server by initializing a Client object, and authenticating

from vantage6.client import Client
# Note: we assume here the config.py you just created is in the current directory.
# If it is not, then you need to make sure it can be found on your PYTHONPATH
import config

# Initialize the client object, and run the authentication
client = Client(config.server_url, config.server_port, config.server_api, verbose=True)
client.authenticate(config.username, config.password)

# Optional: setup the encryption, if you have an organization_key
client.setup_encryption(config.organization_key)

Above, we have added verbose=True as additional argument when creating the Client(...) object. This will print much more information that can be used to debug the issue.

Python client
Creating an organization