How microsoft/smtpoauth2 works
This repository provides two administrator/developer tools: a PowerShell setup script for enabling SMTP OAuth in Exchange Online, and a Java client that obtains an app-only token, authenticates to SMTP, and optionally sends a test message. The Java flow is visible in the excerpt; the PowerShell implementation was not sampled, so its service relationships are documented but unverified.
Main entry points: SMPTOAuth2Test.java Test client CLI · setupOAuth.ps1 Enable SMTP OAuth
Components 10
OAuth setup
- Enable SMTP OAuth
ps/setupOAuth.ps1
Token acquisition
- Test client CLI
java/src/main/java/com/microsoft/smtpoauth/SMPTOAuth2Test.java - Request access token
java/src/main/java/com/microsoft/smtpoauth/SMPTOAuth2Test.java
SMTP test
- Authenticate to SMTP
java/src/main/java/com/microsoft/smtpoauth/SMPTOAuth2Test.java - Compose test message
java/src/main/java/com/microsoft/smtpoauth/SMPTOAuth2Test.java - Send test email
java/src/main/java/com/microsoft/smtpoauth/SMPTOAuth2Test.java
Other components
- Administrator or developer
- Microsoft Entra
- Exchange Online
- Optional recipient
Connections 13
- Administrator or developer → Enable SMTP OAuth: runs setup
README.md - Enable SMTP OAuth → Microsoft Entra: configures OAuth
- Enable SMTP OAuth → Exchange Online: enables SMTP OAuth
- Administrator or developer → Test client CLI: provides credentials
java/src/main/java/com/microsoft/smtpoauth/SMPTOAuth2Test.java - Test client CLI → Request access token: requests token
java/src/main/java/com/microsoft/smtpoauth/SMPTOAuth2Test.java - Request access token → Microsoft Entra: requests token
java/src/main/java/com/microsoft/smtpoauth/SMPTOAuth2Test.java - Test client CLI → Authenticate to SMTP: connects with token
java/src/main/java/com/microsoft/smtpoauth/SMPTOAuth2Test.java - Authenticate to SMTP → Exchange Online: authenticates
java/src/main/java/com/microsoft/smtpoauth/SMPTOAuth2Test.java - Test client CLI → Compose test message: creates message
java/src/main/java/com/microsoft/smtpoauth/SMPTOAuth2Test.java - Administrator or developer → Optional recipient: selects recipient
- Test client CLI → Send test email: sends message
java/src/main/java/com/microsoft/smtpoauth/SMPTOAuth2Test.java - Compose test message → Send test email: supplies message
java/src/main/java/com/microsoft/smtpoauth/SMPTOAuth2Test.java - Optional recipient → Send test email: receives email
java/src/main/java/com/microsoft/smtpoauth/SMPTOAuth2Test.java