class_docstr: Basic MONAILabel Client to invoke infer/train APIs over http/https
class_docstr_tok: ["Basic","MONAILabel","Client","to","invoke","infer\/train","APIs","over","http\/https"]
docstr: Fetch Auth Token.  Currently only basic authentication is supported.
  
  :param username: UserName for basic authentication
  :param password: Password for basic authentication
docstr_tok: ["Fetch","Auth","Token",".","Currently","only","basic","authentication","is","supported",".",":","param","username",":","UserName","for","basic","authentication",":","param","password",":","Password","for","basic","authentication"]
code: def auth_token(self, username, password):
      """
      Fetch Auth Token.  Currently only basic authentication is supported.
  
      :param username: UserName for basic authentication
      :param password: Password for basic authentication
      """
      selector = "/auth/token"
      data = urlencode(
          {
              "username": username,
              "password": password,
              "grant_type": "password",
          }
      )
      status, response, _, _ = MONAILabelUtils.http_method(
          "POST",
          self._server_url,
          selector,
          data,
          None,
          "application/x-www-form-urlencoded",
      )
      if status != 200:
          raise MONAILabelClientException(
              MONAILabelError.SERVER_ERROR,
              f"Status: {status}; Response: {bytes_to_str(response)}",
              status,
              response,
          )
  
      response = bytes_to_str(response)
      logger.debug(f"Response: {response}")
      return json.loads(response)
  
imports: import cgi
  import http.client
  import json
  import logging
  import mimetypes
  import os
  import re
  import ssl
  import tempfile
  from pathlib import Path
  from urllib.parse import quote_plus, unquote, urlencode, urlparse
  import requests
label_desc: Use image node_id 7 for calling the MONAILabelClient obj's underlying member method code with example usage: obj.auth_token(username, password) and returns: json