Removing bad security practice

Secrets should not be stored in clear text files.
Also added syntax highlighting for PowerShell
This commit is contained in:
Friedrich Weinmann 2021-02-01 16:27:20 +01:00 committed by GitHub
parent 5a6e995d70
commit fc8b4b5ace
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,8 +114,8 @@ For more information on Azure AD tokens, see the [Azure AD tutorial](https://doc
### Use PowerShell ### Use PowerShell
``` ```powershell
# That code gets the App Context Token and save it to a file named "Latest-token.txt" under the current directory # 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). # Paste below your Tenant ID, App ID and App Secret (App key).
$tenantId = '' ### Paste your tenant ID here $tenantId = '' ### Paste your tenant ID here
@ -132,8 +132,6 @@ $authBody = [Ordered] @{
} }
$authResponse = Invoke-RestMethod -Method Post -Uri $oAuthUri -Body $authBody -ErrorAction Stop $authResponse = Invoke-RestMethod -Method Post -Uri $oAuthUri -Body $authBody -ErrorAction Stop
$token = $authResponse.access_token $token = $authResponse.access_token
Out-File -FilePath "./Latest-token.txt" -InputObject $token
return $token
``` ```
### Use C#: ### Use C#: