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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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