Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/PalmEmanuel/AzAuth
A PowerShell module to handle authentication for Azure.
https://github.com/PalmEmanuel/AzAuth
azure csharp powershell
Last synced: 8 days ago
JSON representation
A PowerShell module to handle authentication for Azure.
- Host: GitHub
- URL: https://github.com/PalmEmanuel/AzAuth
- Owner: PalmEmanuel
- License: mit
- Created: 2022-03-02T08:38:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-19T20:56:06.000Z (23 days ago)
- Last Synced: 2024-11-29T18:05:40.720Z (13 days ago)
- Topics: azure, csharp, powershell
- Language: PowerShell
- Homepage:
- Size: 219 KB
- Stars: 30
- Watchers: 3
- Forks: 5
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - PalmEmanuel/AzAuth - A PowerShell module to handle authentication for Azure. (PowerShell)
README
# AzAuth
[![AzAuth]][AzAuthGallery] [![AzAuthDownloads]][AzAuthGallery]
AzAuth is a lightweight PowerShell module to handle Azure authentication, using the Azure.Identity MSAL library.
## Installation
AzAuth is published to [PowerShell Gallery](https://www.powershellgallery.com/packages/AzAuth/) and can be installed with a simple command.
```powershell
Install-Module -Name AzAuth
```## Using AzAuth
AzAuth supports multiple ways of getting an access token for a user or identity.
The simplest way is to just run the command, which will look for available tokens among shared tools or sources on the machine.
```PowerShell
# Find a token from already authenticated sources like Azure PowerShell or CLI
# Unless otherwise specified, the command uses ".default" as scope, and "https://graph.microsoft.com" as the resource
Get-AzToken
```AzAuth implements MSAL and also allows for interactive browser logins, and even persistent credential caches!
```PowerShell
Get-AzToken -Interactive -TokenCache 'AzAuthCache'
```AzAuth also caches authentications made for the duration of the session even without specifying a cache, so once you've logged in you can get new access tokens without logging in again. No passwords or credentials are stored, only the refresh token as part of the [authenticated credential](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.interactivebrowsercredential) object.
```PowerShell
Get-AzToken -Resource 'https://management.azure.com'
```For more information, see the help documentation!
```PowerShell
Get-Help Get-AzToken -Full
```## Bug report and feature requests
If you find a bug or have an idea for a new feature, please create an issue in the repo! Before submitting, have a look and see if there are any similar issues already open, in which case you can add to the discussion.
## Contribution
If you like AzAuth and want to contribute, you are very welcome to do so! Please read the [Contribution Guide](CONTRIBUTING.md) to get started!
---
[AzAuthDownloads]: https://img.shields.io/powershellgallery/dt/AzAuth
[AzAuthGallery]: https://www.powershellgallery.com/packages/AzAuth/
[AzAuth]: https://img.shields.io/powershellgallery/v/AzAuth?label=AzAuth