O365 Management API certificate authentication

DPFY 116 Reputation points
2021-10-28T16:05:33.263+00:00

I have setup a PowerShell script to read audit logs using the O365 Management API. It works well but rather than using the Azure AD app's client secret, I would prefer to use a certificate to authenticate, as is possible with MSAL.

In the documentation it only covers the app secret:

$body = @{grant_type="client_credentials";resource=$resource;client_id=$ClientID;client_secret=$ClientSecret}  
$oauth = Invoke-RestMethod -Method Post -Uri $loginURL/$tenantdomain/oauth2/token?api-version=1.0 -Body $body  
$headerParams = @{'Authorization'="$($oauth.token_type) $($oauth.access_token)"}   

ref - https://learn.microsoft.com/en-us/office/office-365-management-api/troubleshooting-the-office-365-management-activity-api

Exchange Server Development
Exchange Server Development
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Development: The process of researching, productizing, and refining new or existing technologies.
512 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful