https://github.com/jheesbrough/ms-teams-puppet-account-manager
Manages microsoft accounts to retrieve teams JSON web tokens for automating tasks that are not supported by the graph API.
https://github.com/jheesbrough/ms-teams-puppet-account-manager
microsoft-teams puppet python selenium teams
Last synced: 3 months ago
JSON representation
Manages microsoft accounts to retrieve teams JSON web tokens for automating tasks that are not supported by the graph API.
- Host: GitHub
- URL: https://github.com/jheesbrough/ms-teams-puppet-account-manager
- Owner: Jheesbrough
- License: mit
- Created: 2024-07-19T15:21:41.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-07-27T13:32:18.000Z (11 months ago)
- Last Synced: 2025-03-08T15:48:27.642Z (4 months ago)
- Topics: microsoft-teams, puppet, python, selenium, teams
- Language: Python
- Homepage: https://pypi.org/project/teams-puppet/
- Size: 79.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Teams Puppet
Manages microsoft accounts to retrieve teams JSON web tokens for automating tasks that are not supported by the graph API.```python
import teams_puppet
import requestspuppet = 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.
```python
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/](https://pypi.org/project/teams-puppet/)
```bash
pip install teams-puppet
```