Token management tools for the Microsoft Graph CLI (mgc)
This project has been archived.
The maintainers of this project have marked this project as archived. No new releases are expected.
Project description
mgc-token-tools
Token management tools for the Microsoft Graph CLI (
mgc)
!WIP! - This project is a work-in-progress and may not be functional.
Features
This repository provides both a library and a command-line utility for interfacing
with the token cache generated by mgc.
The cli (mtt) provides the following features (and more!):
- Status command to identify the current signed-in user, application in-use, and scopes provided by that application (
status) - Alises for useful first-party Microsoft clients (
aliases) - Print an access or refresh token from the OS keyring for a specific client (via the client id) to pass to another tool (AAD-Internals, RoadTools etc) (
dump) - FOCI client login similar to
Invoke-RefreshTo<X>commands provided by TokenTactics (refresh-to) - Store a correctly-formatted access or refresh token sourced outside
mgcin themgctoken cache (insert) - Switch between applications with valid access tokens (
switch)
Command-line Usage
usage: mtt [-h] subcommand ...
Utilities for the Microsoft Graph CLI (mgc)
positional arguments:
subcommand
login Login to Microsoft Graph
logout Delete the token cache and authentication record
list Print all MSAL tokens currently stored in the keyring
aliases List alias for application client ids
dump Print an MSAL token from the keyring
refresh-to Pass a refresh token or use an existing cached refresh token to login to
another foci client
insert Insert a token aquired through other means into the token cache
status Print current client_id and tenant_id
switch Switch to another client with available access tokens
options:
-h, --help show this help message and exit
Installation & Requirements
The script has no external python dependencies, but does use the security command on MacOS or secret-tool on Linux for keyring access.
Installation from PyPI
# with pip
pip install mgc-token-tools
# with uv for library or project-specific usage
uv add mgc-token-tools
# with uv for non-project-specific access to the cli
uv tool add mgc-token-tools
Keyring Support
So far, this has been tested with MacOS Keychain and GNOME Keyring on Linux.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mgc_token_tools-0.1.2.tar.gz.
File metadata
- Download URL: mgc_token_tools-0.1.2.tar.gz
- Upload date:
- Size: 11.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b197d65146c3fd920b6441d7d838e14056fc7009776176e7aeb647a20697c8f3
|
|
| MD5 |
bfa9f65251ef21adcffb4a4351baa157
|
|
| BLAKE2b-256 |
553793b57bafea98c8059f47209d94dd9aae56de2556c05f9ec4c4364fa76509
|
File details
Details for the file mgc_token_tools-0.1.2-py3-none-any.whl.
File metadata
- Download URL: mgc_token_tools-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d50fcdf7a5c2ec73586c2371541d3bb05b55c8a38e66fa30903b5b658541d4c2
|
|
| MD5 |
916bd8f0cd3d6c4e15f569074d6ed27b
|
|
| BLAKE2b-256 |
b04544471e5ba723044c5c7bca74a21edafc0cd43f9cd79191de3a114edf24bd
|