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

Uploaded Source

Built Distribution

teams_puppet-0.2.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: teams_puppet-0.2.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.4 Windows/10

File hashes

Hashes for teams_puppet-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ad323474f8e2e455d80283f6d2394d2aea3b0523e1f68db2f73b32fe5538a0f3
MD5 de59e571c5fe66200da9ef596b4e8872
BLAKE2b-256 75b4fe3350324f8ce86b59bcb60f23605f2b5eb5966cf525ba00749df65dd17a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: teams_puppet-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.4 Windows/10

File hashes

Hashes for teams_puppet-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0141acf0a017d636654adf8e4930c716f1186aa2abdafb6bf7e9c23c5eafc76e
MD5 8262c5d8297c63fc00dee0ef4be683b8
BLAKE2b-256 9ba5e06640a5ac043a1f4772deec398f645f21fe9e53831c923d9eb3aeb5841a

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