Skip to content

socteam-sdt/MiToken

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MiToken img

MiToken is a PowerShell module designed to be used with PowerShell Azure Automation runbooks. It will obtain an access token from the managed identity endpoint from within your runbook, then exchange it for a multi-tenant app access token, using the managed identity token as an assertion.

This will allow you to connect to external tenants that have provided consent to your multi-tenant application via Microsoft Graph PowerShell in a managed identity scenario.

🔗Connect with me on LinkedIn

Support

This MiToken module is provided 'as is' and has only been tested from within an Azure Automation runbook. Currently it is known to work with the latest Microsoft Graph PowerShell module (v2.6.1) and the PowerShel v7.4 runtime environment.

Requirements

  • PowerShell 7 or later
  • Microsoft.Graph.Authentication module (required dependency)
  • To be run from a managed identity environment

Installation

# Install Microsoft.Graph.Authentication dependency first
Install-Module -Name Microsoft.Graph.Authentication

# Install MiToken from PSGallery
Install-Module -Name MiToken

# Or clone this repository
git clone https://github.com/DanielBradley1/MiToken.git

Usage

Connect to Microsoft Graph

# Import the module
Import-Module MiToken

# Connect with specific tenant and client ID. All parameters are mandatory.
Connect-MiGraph -TenantId "TENANT_ID" -ClientId "CLIENT_ID" -IdentityClientId "MANAGED_IDENTITY_CLIENT_ID"

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • PowerShell 100.0%