msoauth-1.0.0 is not a library.
Visit the last successful build:
msoauth-1.1.1
msoauth
A simple CLI tool for retrieving, refreshing, and printing Microsoft OAuth2 tokens via the Device Code flow. Useful for tools like NeoMutt with OAuth2-based accounts.
Features
- Authenticates using Microsoft OAuth2 Device Code flow
- Automatically saves/refreshes access tokens
- Prints access token for use in scripts or email clients
- Logs activity via tracing
- Friendly error messages and self-healing default mode
Requirements
- Rust (use rustup to install)
- A registered Azure AD app with the following:
- client_id
- tenant_id
- client_secret
- Scopes (e.g. https://graph.microsoft.com/.default)
Installation
Configuration
Create the file:
With the contents:
= "YOUR_CLIENT_ID"
= "YOUR_CLIENT_SECRET"
= "YOUR_TENANT_ID"
= "https://graph.microsoft.com/.default"
To obtain these values:
- Go to https://portal.azure.com
- Navigate to Azure Active Directory > App Registrations
- Register a new app
- Under Overview, copy the
Application (cliend) IDandDirectory (tenant) ID. - Under Certificates & secrets, create a new client secret.
- Under API Permissions. Add
Microsoft Graph > Delegated | User.Reador other needed scopes.
Usage
Token is stored at:
Integration Example (NeoMutt)
License
MIT