docstr: Koa, 04 May 2022    Get SSO login auth_url or token
docstr_tok: ["Koa",",","04","May","2022","Get","SSO","login","auth_url","or","token"]
code: def sso_login(self, org_name=None, idp_name=None):
      """
      Koa, 04 May 2022    Get SSO login auth_url or token
      """
      # from .pygraphistry import PyGraphistry
      base_path = self.server_base_path
  
      if org_name is None and idp_name is None:
          print("Login to site wide SSO")
          url = f"{base_path}/api/v2/g/sso/oidc/login/"
      elif org_name is not None and idp_name is None:
          print("Login to {} organization level SSO".format(org_name))
          url = f"{base_path}/api/v2/o/{org_name}/sso/oidc/login/"
      elif org_name is not None and idp_name is not None:
          print("Login to {} idp {} SSO".format(org_name, idp_name))
          url = f"{base_path}/api/v2/o/{org_name}/sso/oidc/login/{idp_name}/"
  
      # print("url : {}".format(url))
      out = requests.post(
          url,
          data={"client-type": "pygraphistry"},
          verify=self.certificate_validation,
      )
  
      json_response = None
      try:
          logger.debug(
              "@ArrowUploader.sso_login, out.text: %s", out.text
          )
          json_response = out.json()
          logger.debug(
              "@ArrowUploader.sso_login, json_response: %s",
              json_response,
          )
          self.token = None
          if not ("status" in json_response):
              raise Exception(out.text)
          else:
              if json_response["status"] == "OK":
                  logger.debug(
                      "@ArrowUploader.sso_login, json_data : %s",
                      json_response["data"],
                  )
                  if "state" in json_response["data"]:
                      self.sso_state = json_response["data"]["state"]
                      self.sso_auth_url = json_response["data"][
                          "auth_url"
                      ]
                  else:
                      self.token = json_response["data"]["token"]
              elif json_response["status"] == "ERR":
                  raise Exception(json_response["message"])
  
      except Exception:
          logger.error("Error: %s", out, exc_info=True)
          print(
              "\nThere is error with the SSO login, please check your SSO and IDP configuration"
          )
          raise
  
      return self
  
imports: from typing import List, Optional
  import io, pyarrow, requests, sys
  from graphistry.privacy import Mode, Privacy
  from .ArrowFileUploader import ArrowFileUploader
  from .util import setup_logger
label_desc: Use image node_id 31 for calling the ArrowUploader obj's underlying member method code with example usage: obj.sso_login(org_name, idp_name) and returns: self