Skip to content

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

License

Notifications You must be signed in to change notification settings

Jheesbrough/MS-Teams-Puppet-Account-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 Outlook backend scope or the token used to access loki.delve.office.com.

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

Installation

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

pip install teams-puppet

About

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

Topics

Resources

License

Stars

Watchers

Forks

Languages