From fc8b4b5ace2289960f62f476cd0b2273442958ac Mon Sep 17 00:00:00 2001 From: Friedrich Weinmann Date: Mon, 1 Feb 2021 16:27:20 +0100 Subject: [PATCH 1/3] Removing bad security practice Secrets should not be stored in clear text files. Also added syntax highlighting for PowerShell --- .../exposed-apis-create-app-webapp.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.md b/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.md index dbec1029c4..ba69e010b7 100644 --- a/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.md +++ b/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.md @@ -114,8 +114,8 @@ For more information on Azure AD tokens, see the [Azure AD tutorial](https://doc ### Use PowerShell -``` -# That code gets the App Context Token and save it to a file named "Latest-token.txt" under the current directory +```powershell +# That code gets the App Context Token and save it to the variable $token for later use in the script # Paste below your Tenant ID, App ID and App Secret (App key). $tenantId = '' ### Paste your tenant ID here @@ -132,8 +132,6 @@ $authBody = [Ordered] @{ } $authResponse = Invoke-RestMethod -Method Post -Uri $oAuthUri -Body $authBody -ErrorAction Stop $token = $authResponse.access_token -Out-File -FilePath "./Latest-token.txt" -InputObject $token -return $token ``` ### Use C#: From 7339433924a6d11ba35669fcb2168bfaa912582b Mon Sep 17 00:00:00 2001 From: Daniel Simpson Date: Thu, 4 Feb 2021 15:14:39 -0800 Subject: [PATCH 2/3] Update windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.md Co-authored-by: Trond B. Krokli <38162891+illfated@users.noreply.github.com> --- .../microsoft-defender-atp/exposed-apis-create-app-webapp.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.md b/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.md index ba69e010b7..9b4c3f384c 100644 --- a/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.md +++ b/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.md @@ -115,8 +115,8 @@ For more information on Azure AD tokens, see the [Azure AD tutorial](https://doc ### Use PowerShell ```powershell -# That code gets the App Context Token and save it to the variable $token for later use in the script -# Paste below your Tenant ID, App ID and App Secret (App key). +# This script acquires the App Context Token and stores it in the variable $token for later use in the script. +# Paste your Tenant ID, App ID and App Secret (App key) into the indicated quotes below. $tenantId = '' ### Paste your tenant ID here $appId = '' ### Paste your Application ID here From 24d477291a28811e88ed0b0c4a9126cb55186131 Mon Sep 17 00:00:00 2001 From: Daniel Simpson Date: Wed, 17 Feb 2021 21:36:01 -0800 Subject: [PATCH 3/3] Update windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.md Co-authored-by: JohanFreelancer9 <48568725+JohanFreelancer9@users.noreply.github.com> --- .../microsoft-defender-atp/exposed-apis-create-app-webapp.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.md b/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.md index 9b4c3f384c..17498cdd14 100644 --- a/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.md +++ b/windows/security/threat-protection/microsoft-defender-atp/exposed-apis-create-app-webapp.md @@ -116,7 +116,7 @@ For more information on Azure AD tokens, see the [Azure AD tutorial](https://doc ```powershell # This script acquires the App Context Token and stores it in the variable $token for later use in the script. -# Paste your Tenant ID, App ID and App Secret (App key) into the indicated quotes below. +# Paste your Tenant ID, App ID, and App Secret (App key) into the indicated quotes below. $tenantId = '' ### Paste your tenant ID here $appId = '' ### Paste your Application ID here