code: def _get_auth_token(self):
          
          url = '/%s/oauth2/token' % getattr(
              settings, 'RESTCLIENTS_O365_TENANT', 'test')
          headers = {'Accept': 'application/json'}
          data = {
              "grant_type": "client_credentials",
              "client_id": getattr(settings,
                                   'RESTCLIENTS_O365_CLIENT_ID',
                                   None),
              "client_secret": getattr(settings,
                                       'RESTCLIENTS_O365_CLIENT_SECRET',
                                       None),
              "resource": self._api_host
          }
          body = urlencode(data)
          auth_pool = self._get_pool(self._auth_host)
          response = get_live_url(auth_pool, 'POST', self._auth_host,
                                  url, headers=headers, body=body,
                                  service_name='o365')
          try:
              json_data = json.loads(response.data)
              if response.status == 200:
                  return "%s %s" % (
                      json_data['token_type'], json_data['access_token'])
              else:
                  raise DataFailureException(
                      url, response.status,
                      'Auth token failure: %s - %s' % (
                          json_data.get('error', 'unknown'),
                          json_data.get('error_description', 'no description')))
          except ValueError:
              raise DataFailureException(
                  url, response.status,
                  'Auth token failure: %s' % (response.data))
docs: Given the office356 tenant and client id, and client secret
          acquire a new authorization token