Skip to main content

Retrieves teams users JSON web tokens.

Project description

Teams Puppet

Manages microsoft accounts to retrieve teams JSON web tokens for automating tasks that are not supported by the graph API.

import teams_puppet
import requests

puppet = teams_puppet.Puppet("email", "password")

headers = {
    "accept": "application/json",
    "Content-Type": "application/json",
    "authorization": "Bearer " + puppet.get_token("teams"),
    "X-ClientType": "MicrosoftTeamsAngular",
    "X-HostAppRing": "general"
}

response = requests.get("https://teams.microsoft.com/api/example", headers=headers)

The token is fetched on puppet initialization. If the token expires, a new one will be fetched automatically.

The puppet can either fetch the teams token that uses the Skype backend scope or the token used to access loki.delve.office.com.

puppet = teams_puppet.Puppet("email", "password")
skype_token = puppet.get_token("teams")
loki_token = puppet.get_token("loki")

Installation

Available on PyPi pypi.org/project/teams-puppet/

pip install teams-puppet

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

teams_puppet-0.1.5.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

teams_puppet-0.1.5-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file teams_puppet-0.1.5.tar.gz.

File metadata

  • Download URL: teams_puppet-0.1.5.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Windows/11

File hashes

Hashes for teams_puppet-0.1.5.tar.gz
Algorithm Hash digest
SHA256 990bb61e9183ca1f9e889e0d598b9c71ab2d8eced6f223ae9ff6053aeb09ecd6
MD5 5550a12915b5339841dc22fe1bdd2579
BLAKE2b-256 06567e21c2690b29b6053155706c0a18481ea4c6017fe26ecc93585f97af9d63

See more details on using hashes here.

File details

Details for the file teams_puppet-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: teams_puppet-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Windows/11

File hashes

Hashes for teams_puppet-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 864385fccd07741062bf19dfddd666ff7c8754b3b96bcf37e3678dbeb1935571
MD5 525d181ccf55468614e61cc669a972a4
BLAKE2b-256 c87ea87f597ee951fb36a36346971dd5b4ccdc2621d7ac8e084090f7a0ef5edd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page