--- title: "STEP 2: Retrieve authorization code (o365-audit-logs)" slug: "step-2-retrieve-authorization-code" updated: 2026-03-17T11:00:54Z published: 2026-03-17T11:00:54Z canonical: "docs.hunters.ai/step-2-retrieve-authorization-code" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.hunters.ai/llms.txt > Use this file to discover all available pages before exploring further. # STEP 2: Retrieve authorization code (o365-audit-logs) In this step you will use the information gathered in step 1 to retrieve an authorization code, required to complete the next step. **To retrieve an authorization code:** 1. Copy and paste the following URL in the notepad: ```plaintext https://login.microsoftonline.com/YOUR_TENANT_ID/oauth2/v2.0/authorize?client_id=YOUR_CLIENT_ID&response_type=code&redirect_uri=http://localhost:5110&response_mode=query&scope=offline_access%20https://manage.office.com/ActivityFeed.Read ``` 2. Now, replace the **{YOUR_TENANT_ID} and {YOUR_CLIENT_ID}** value in the URL with the values you saved in the previous step. 3. Open a new tab in the same browser used to log into Azure, paste the URL into the address bar, and hit **ENTER**. You’ll now see an error message and the URL in the address bar will change. 📘Note The updated URL will now include your **authorization code**. The code is the string appearing between the `code=` and `&`. 4. Copy the updated URL from the address bar and paste it into your notepad.