1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-14 02:08:50 +02:00

added org duo to 2fa flow

This commit is contained in:
Kyle Spearrin 2018-04-03 14:33:00 -04:00
parent 551217ea38
commit 3643222b3c
6 changed files with 28 additions and 18 deletions

View File

@ -216,8 +216,9 @@ angular
function init() { function init() {
stopU2fCheck = true; stopU2fCheck = true;
var params; var params;
if ($scope.twoFactorProvider === constants.twoFactorProvider.duo) { if ($scope.twoFactorProvider === constants.twoFactorProvider.duo ||
params = $scope.twoFactorProviders[constants.twoFactorProvider.duo]; $scope.twoFactorProvider === constants.twoFactorProvider.organizationDuo) {
params = $scope.twoFactorProviders[$scope.twoFactorProvider];
$window.Duo.init({ $window.Duo.init({
host: params.Host, host: params.Host,

View File

@ -6,6 +6,9 @@
$scope.providers = []; $scope.providers = [];
if (providers.hasOwnProperty(constants.twoFactorProvider.organizationDuo)) {
add(constants.twoFactorProvider.organizationDuo);
}
if (providers.hasOwnProperty(constants.twoFactorProvider.authenticator)) { if (providers.hasOwnProperty(constants.twoFactorProvider.authenticator)) {
add(constants.twoFactorProvider.authenticator); add(constants.twoFactorProvider.authenticator);
} }

View File

@ -83,7 +83,8 @@
</form> </form>
</div> </div>
<div ng-if="twoFactorProvider === twoFactorProviderConstants.duo"> <div ng-if="twoFactorProvider === twoFactorProviderConstants.duo ||
twoFactorProvider === twoFactorProviderConstants.organizationDuo">
<p class="login-box-msg"> <p class="login-box-msg">
Complete logging in with Duo. Complete logging in with Duo.
</p> </p>

View File

@ -99,14 +99,15 @@ angular.module('bit')
type: 0, type: 0,
name: 'Authenticator App', name: 'Authenticator App',
description: 'Use an authenticator app (such as Authy or Google Authenticator) to generate time-based ' + description: 'Use an authenticator app (such as Authy or Google Authenticator) to generate time-based ' +
'verification codes.', 'verification codes.',
enabled: false, enabled: false,
active: true, active: true,
free: true, free: true,
image: 'authapp.png', image: 'authapp.png',
displayOrder: 0, displayOrder: 0,
priority: 1, priority: 1,
requiresUsb: false requiresUsb: false,
organization: false
}, },
{ {
type: 3, type: 3,
@ -117,7 +118,8 @@ angular.module('bit')
image: 'yubico.png', image: 'yubico.png',
displayOrder: 1, displayOrder: 1,
priority: 3, priority: 3,
requiresUsb: true requiresUsb: true,
organization: false
}, },
{ {
type: 2, type: 2,
@ -128,7 +130,8 @@ angular.module('bit')
image: 'duo.png', image: 'duo.png',
displayOrder: 2, displayOrder: 2,
priority: 2, priority: 2,
requiresUsb: false requiresUsb: false,
organization: false
}, },
{ {
type: 4, type: 4,
@ -139,7 +142,8 @@ angular.module('bit')
image: 'fido.png', image: 'fido.png',
displayOrder: 3, displayOrder: 3,
priority: 4, priority: 4,
requiresUsb: true requiresUsb: true,
organization: false
}, },
{ {
type: 1, type: 1,
@ -151,20 +155,21 @@ angular.module('bit')
image: 'gmail.png', image: 'gmail.png',
displayOrder: 4, displayOrder: 4,
priority: 0, priority: 0,
requiresUsb: false requiresUsb: false,
} organization: false
], },
orgTwoFactorProviderInfo: [
{ {
type: 6, type: 6,
name: 'Duo', name: 'Duo (Organization)',
description: 'Verify with Duo Security using the Duo Mobile app, SMS, phone call, or U2F security key.', description: 'Verify with Duo Security for your organization using the Duo Mobile app, SMS, ' +
'phone call, or U2F security key.',
enabled: false, enabled: false,
active: true, active: true,
image: 'duo.png', image: 'duo.png',
displayOrder: 1, displayOrder: 1,
priority: 0, priority: 10,
requiresUsb: false requiresUsb: false,
organization: true
} }
], ],
plans: { plans: {

View File

@ -5,7 +5,7 @@
$analytics, appSettings, constants, $filter) { $analytics, appSettings, constants, $filter) {
$scope.selfHosted = appSettings.selfHosted; $scope.selfHosted = appSettings.selfHosted;
$scope.model = {}; $scope.model = {};
$scope.twoStepProviders = constants.orgTwoFactorProviderInfo; $scope.twoStepProviders = $filter('filter')(constants.twoFactorProviderInfo, { organization: true });
$scope.use2fa = false; $scope.use2fa = false;
$scope.$on('$viewContentLoaded', function () { $scope.$on('$viewContentLoaded', function () {

View File

@ -3,7 +3,7 @@
.controller('settingsTwoStepController', function ($scope, apiService, toastr, $analytics, constants, .controller('settingsTwoStepController', function ($scope, apiService, toastr, $analytics, constants,
$filter, $uibModal, authService) { $filter, $uibModal, authService) {
$scope.providers = constants.twoFactorProviderInfo; $scope.providers = $filter('filter')(constants.twoFactorProviderInfo, { organization: false });
$scope.premium = true; $scope.premium = true;
authService.getUserProfile().then(function (profile) { authService.getUserProfile().then(function (profile) {