code: def bearer_token_request(
      tenant_id: str, client_id: str, client_secret: str
  ) -> Any:
      """
      Sends a request to login.microsoftonline.com for the given tenant to generate a bearer token
      which is then used in making graph api call
  
      tenant_id: tenant ID is a globally unique identifier (GUID) for your organization
      that is different from your organization or domain name
      client_id: client ID is a globally unique identifier (GUID) for your app registered in Entra
      client_secret: client secret is the password of the service principal or the app.
  
      Returns
      response: Dictionary containing bearer token and other information
      """
      url = (
          f"https://login.microsoftonline.com/{tenant_id}/oauth2/token"
      )
  
      payload = {
          "client_id": client_id,
          "client_secret": client_secret,
          "redirect_uri": "http://localhost",
          "grant_type": "client_credentials",
          "resource": "https://graph.microsoft.com",
      }
      files = []
      headers = {}
  
      response = getresponse(
          request_type="POST",
          url=url,
          headers=headers,
          payload=payload,
          files=files,
      )
      response = response.json()
      return response
  
file_path: mindsdb/mindsdb/integrations/handlers/sharepoint_handler/utils.py
imports: import json
  from typing import Dict, List, Text, Any
  import requests
  from requests import Response
label_desc: Use image node_id 5 for calling a global function with example usage: bearer_token_request(tenant_id, client_id, client_secret) and returns: response