This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| :nextAppService Foreach ($appService in $allAppServices) | |
| { | |
| $appServiceName = $appService.Name | |
| Foreach ($appServiceToExclude in $AppServicesToExclude) | |
| { | |
| if($appServiceToExclude.ToLower().Contains($appServiceName.ToLower())) | |
| { | |
| Write-Output "Skipped app service $appServiceName as it is in the exclude list" | |
| continue nextAppService |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Add-AccessRestrictionsToAppServices([string] $ResourceGroupName, | |
| [string] $JsonFilename, | |
| [bool] $RemoveExistingRules, | |
| [string[]] $AppServicesToExclude) | |
| { | |
| Write-Information "Retrieving all app services in $ResourceGroupName" | |
| $allAppServices = Get-AzWebApp -ResourceGroupName $ResourceGroupName | |
| $confirmAppServicesToExclude = Confirm-AppServicesToExclude -AllAppServices $allAppServices -AppServicesToExclude $AppServicesToExclude | |
| if (!$confirmAppServicesToExclude) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { "rulename": "gateway", "ipaddress": "213.46.145.111", "priority": "200" }, | |
| { "rulename": "vpn", "ipaddress": "210.46.145.111", "priority": "300" }, | |
| { "rulename": "test", "ipaddress": "215.46.145.111", "priority": "400" } | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Remove all access restrictions from the app services in the given resource group | |
| .DESCRIPTION | |
| The Remove-AccessRestrictions.ps1 script removes all access restrictions from | |
| the app services in the given resource group | |
| .PARAMETER resourceGroupName | |
| The resource group with the app services to remove the access restrictions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Remove-AccessRestrictionsFromAppService([string] $ResourceGroupName, [string] $Name) { | |
| $config = Get-AzWebAppAccessRestrictionConfig -ResourceGroupName $ResourceGroupName -Name $Name | |
| Write-Information "Removing existing access restrictions on $Name" | |
| Foreach ($accessRestriction in $config.MainSiteAccessRestrictions) { | |
| $ruleName = $accessRestriction.RuleName | |
| Write-Debug "Removing rule $ruleName" | |
| Remove-AzWebAppAccessRestrictionRule -ResourceGroupName $ResourceGroupName -WebAppName $Name -Name $accessRestriction.RuleName | |
| } | |
| # Also remove all the access restriction from the staging slots |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Remove-AllAccessRestrictionsFromAppServices([string] $ResourceGroupName) { | |
| Write-Information "Retrieving all app services in $ResourceGroupName" | |
| $allAppServices = Get-AzWebApp -ResourceGroupName $ResourceGroupName | |
| Foreach ($appService in $allAppServices) { | |
| Remove-AccessRestrictionsFromAppService -ResourceGroupName $ResourceGroupName -Name $appService.Name | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div> | |
| <h3>Two Factor Registration</h3> | |
| <img v-bind:src="qr" /> | |
| <form @submit.prevent="validateToken"> | |
| <label for="token"> | |
| Enter token to enable two factor authentication: | |
| </label> | |
| <input v-model="token" type="text" name="token" value /> | |
| <button type="submit" name="button">validate</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| validateToken({ commit }, credentials) { | |
| return apiClient | |
| .post('/user/validatetoken', credentials) | |
| .then(({ data }) => { | |
| commit('SET_TWOFACTOR_LOGIN', data.validated); | |
| }); | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| validateToken() { | |
| this.$store | |
| .dispatch('validateToken', { | |
| token: this.token, | |
| }) | |
| .then(() => { | |
| if (this.$store.state.twofactorvalidated) { | |
| this.$router.push({ name: 'dashboard' }); | |
| } else { | |
| this.error = 'The provided token was not valid, please try again'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div> | |
| <h3>{{ title }}</h3> | |
| <form v-if="!showTwoFactorPanel" @submit.prevent="login"> | |
| <label for="email"> Email: </label> | |
| <input v-model="email" type="email" name="email" value /> | |
| <label for="password"> Password: </label> | |
| <input v-model="password" type="password" name="password" value /> | |
| <button type="submit" name="button">Login</button> | |
| <p>{{ error }}</p> |