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.6.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

teams_puppet-0.1.6-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: teams_puppet-0.1.6.tar.gz
  • Upload date:
  • Size: 5.1 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.6.tar.gz
Algorithm Hash digest
SHA256 5614ea76ed774ba091b57d2bae0ac2828bf86eb47fd78b26780c95ae4b64aec7
MD5 55f6a11c6cbc65b987e1564b7da9fa2d
BLAKE2b-256 8e6a0ef7c1e1961fc62060c977a626698e1837feade60efa9ed399decc9e9dbc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: teams_puppet-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 5.5 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 60894e8768302a37718a2eae8e0f9581ce4f843a9a47a4c0a43e595a0038c6cb
MD5 bd1e3970f58b0dfcf25278b7e022a2e6
BLAKE2b-256 82247f7e4c61a1ff9864c107db5c4e06cc46c545177851d7a94219ded355674d

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