pygraphistry icon indicating copy to clipboard operation
pygraphistry copied to clipboard

Org sso login

Open vaimdev opened this issue 2 years ago • 10 comments

adds:

  • sitewide sso
  • org sso
  • personal key

vaimdev avatar May 28 '22 06:05 vaimdev

  • @webcoderz for help on next round of testing

lmeyerov avatar Jul 15 '22 16:07 lmeyerov

Looks like passing in an invalid org id gives a misleading error:

 Error: <Response [201]>
Traceback (most recent call last):
  File "/home/graphistry/.local/lib/python3.8/site-packages/graphistry/arrow_uploader.py", line 204, in login
    raise Exception("Server does not support organization, please omit org_name")
Exception: Server does not support organization, please omit org_name
---------------------------------------------------------------------------
Exception                                 Traceback (most recent call last)
/tmp/ipykernel_21549/2293093499.py in <module>
----> 1 graphistry.register(api=3, server='eks-dev.grph.xyz', protocol='https', username='gadmin', password='G@dmin123!', org_name='org3')
      2 #graphistry.register(api=3, username='leotest3', password='accountaccount')

~/.local/lib/python3.8/site-packages/graphistry/pygraphistry.py in register(key, username, password, token, server, protocol, api, certificate_validation, bolt, token_refresh_ms, store_token_creds_in_memory, client_protocol_hostname, org_name, idp_name, sso_timeout)
    581 
    582         if not (username is None) and not (password is None):
--> 583             PyGraphistry.login(username, password, org_name)
    584             PyGraphistry.api_token(token or PyGraphistry._config['api_token'])
    585             PyGraphistry.authenticate()

~/.local/lib/python3.8/site-packages/graphistry/pygraphistry.py in login(username, password, org_name, fail_silent)
    134         PyGraphistry._is_authenticated = False
    135         token = (
--> 136             ArrowUploader(
    137                 server_base_path=PyGraphistry.protocol()
    138                 + "://"                     # noqa: W503

~/.local/lib/python3.8/site-packages/graphistry/arrow_uploader.py in login(self, username, password, org_name)
    202             if org_name:  # caller pass in org_name
    203                 if not logged_in_org_name:  # no active_organization in JWT payload
--> 204                     raise Exception("Server does not support organization, please omit org_name")
    205                 else:
    206                     # if JWT response with org_name different than the pass in org_name

Exception: Server does not support organization, please omit org_name

lmeyerov avatar Sep 04 '22 20:09 lmeyerov

I was trying to do sso (site-wide) to work from a notebook but could not. Any guidance?

graphistry.register(
    api=3,
    server='***.grph.xyz', protocol='https',
    #idp_name='Site_wide_SSO_Provider'
    #sso_timeout=30000,
     org_name=''Site_wide_SSO_Provider''
)

=>

IOPub data rate exceeded.
The Jupyter server will temporarily stop sending output
to the client in order to avoid crashing it.
To change this limit, set the config variable
`--ServerApp.iopub_data_rate_limit`.

Current values:
ServerApp.iopub_data_rate_limit=1000000.0 (bytes/sec)
ServerApp.rate_limit_window=3.0 (secs)

lmeyerov avatar Sep 04 '22 21:09 lmeyerov

Yea looks like this hasn't been resolved after testing ? https://github.com/graphistry/pygraphistry/issues/373

webcoderz avatar Sep 04 '22 21:09 webcoderz

how did you use the site-wide sso there? the snipped had just "", so i'm not actually sure what you were testing

lmeyerov avatar Sep 05 '22 05:09 lmeyerov

Koa reports:

  • Currently only supports org-specific IDPs
  • He is adding sitewide

Ah, relevant: in hub, if we have a sitewide idp, orgs may want to only use their idp... so maybe it's more like, an org picks which IDPs are on and for what? (org signin, org self-join, and if admin, reuse as sitewide idp?)

lmeyerov avatar Sep 10 '22 00:09 lmeyerov

(pk not ready for testing yet)

lmeyerov avatar Sep 17 '22 00:09 lmeyerov

sso ready for re-testing: register(server=, protocol=, ) => will default to sitewide sso

lmeyerov avatar Sep 17 '22 00:09 lmeyerov

Discussion: how to pick whether to use sitewide idp vs org?

lmeyerov avatar Sep 17 '22 00:09 lmeyerov

Discussion: How to switch / reset auth?

lmeyerov avatar Sep 17 '22 00:09 lmeyerov

FYI, a bunch of fixes on main branch in case your CI has a lot of false positives. Still a false positive from py3.10 around mypi, but that should be it.

lmeyerov avatar Sep 25 '22 01:09 lmeyerov

This branch is no longer used, there is a new branch with personal key feature, I'll create another PR

vaimdev avatar Oct 22 '22 00:10 vaimdev