Skip to content

Commit

Permalink
Changes checked value to .isSoftwareOathEnabled. (maester365#463)
Browse files Browse the repository at this point in the history
  • Loading branch information
lbrauns committed Sep 10, 2024
1 parent 05a0357 commit 7bbb7a2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
4 changes: 1 addition & 3 deletions powershell/internal/eidsca/Test-MtEidscaAM02.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
Defines if users can use the OTP code generated by the Authenticator App.

enabled

#### Test script
```
https://graph.microsoft.com/beta/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')
.state = 'enabled'
.isSoftwareOathEnabled = 'True'
```

#### Related links
Expand Down
16 changes: 8 additions & 8 deletions powershell/internal/eidsca/Test-MtEidscaAM02.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
Queries policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')
and returns the result of
graph/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator').state -eq 'enabled'
graph/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator').isSoftwareOathEnabled -eq 'True'
.EXAMPLE
Test-MtEidscaAM02
Returns the result of graph.microsoft.com/beta/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator').state -eq 'enabled'
Returns the result of graph.microsoft.com/beta/policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator').isSoftwareOathEnabled -eq 'enabled'
#>

function Test-MtEidscaAM02 {
Expand All @@ -27,16 +27,16 @@ function Test-MtEidscaAM02 {
}
$result = Invoke-MtGraphRequest -RelativeUri "policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')" -ApiVersion beta

[string]$tenantValue = $result.state
$testResult = $tenantValue -eq 'enabled'
$tenantValueNotSet = $null -eq $tenantValue -and 'enabled' -notlike '*$null*'
[string]$tenantValue = $result.isSoftwareOathEnabled
$testResult = $tenantValue -eq 'True'
$tenantValueNotSet = $null -eq $tenantValue -and 'True' -notlike '*$null*'

if($testResult){
$testResultMarkdown = "Well done. The configuration in your tenant and recommended value is **'enabled'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
$testResultMarkdown = "Well done. The configuration in your tenant and recommended value is **'True'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
} elseif ($tenantValueNotSet) {
$testResultMarkdown = "Your tenant is **not configured explicitly**.`n`nThe recommended value is **'enabled'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**. It seems that you are using a default value by Microsoft. We recommend to set the setting value explicitly since non set values could change depending on what Microsoft decides the current default should be."
$testResultMarkdown = "Your tenant is **not configured explicitly**.`n`nThe recommended value is **'True'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**. It seems that you are using a default value by Microsoft. We recommend to set the setting value explicitly since non set values could change depending on what Microsoft decides the current default should be."
} else {
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'enabled'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
$testResultMarkdown = "Your tenant is configured as **$($tenantValue)**.`n`nThe recommended value is **'True'** for **policies/authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')**"
}
Add-MtTestResultDetail -Result $testResultMarkdown

Expand Down

0 comments on commit 7bbb7a2

Please sign in to comment.