pygraphistry icon indicating copy to clipboard operation
pygraphistry copied to clipboard

register(token=...) leaves session unauthenticated

Open lmeyerov opened this issue 2 months ago • 0 comments

Summary

When we bootstrap a graphistry.client() with an existing JWT token, calling client.register(token=..., api=3, ...) stores the token but leaves the session unauthenticated. Subsequent plot()/upload() calls raise ValueError: Must call login() first even though the token is valid. Downstream code currently has to set client.session._is_authenticated = True manually after register.

Steps to Reproduce

import graphistry
import pandas as pd

client = graphistry.client()
client.register(api=3,
                protocol='http',
                server='localhost',
                token='<valid JWT token>')

print('is_authenticated', client.session._is_authenticated)

edges = pd.DataFrame({'src': [0, 1], 'dst': [1, 0]})
plotter = client.edges(edges, 'src', 'dst')
plotter.upload()  # raises ValueError: Must call login() first

client.session._is_authenticated remains False, so any call requiring auth fails.

Expected Behavior

register(token=...) should mark the session authenticated (or otherwise allow plot()/upload() to proceed) when a valid JWT token is provided.

Actual Behavior

  • client.session._is_authenticated stays False
  • plot() / upload() raise ValueError: Must call login() first

Workaround

Set client.session._is_authenticated = True manually after calling register(), but this reaches into private state.

Environment

  • PyGraphistry 0.45.5
  • Reproduced both outside and inside Docker (Graphistry server stack)

lmeyerov avatar Oct 21 '25 08:10 lmeyerov