Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Commit 74623d3

Browse files
author
Billy Clark
committed
needed some test users pre-loaded for convenience.
1 parent 6943a09 commit 74623d3

File tree

3 files changed

+104
-8
lines changed

3 files changed

+104
-8
lines changed

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ If configured, an alert will be shown to the user filled with the content of tha
116116
4. Click **Test configured authentication sources**
117117
5. Click **hub-discovery**
118118
6. Click **idp2**
119-
7. Login as an an "about to expire" user: `username=`**near_future** `password=`**b**
119+
7. Login as an "about to expire" user: `username=`**near_future** `password=`**b**
120120
8. Click **Later**
121121
9. Click **Logout**
122122

@@ -127,7 +127,7 @@ If configured, an alert will be shown to the user filled with the content of tha
127127
4. Click **Test configured authentication sources**
128128
5. Click **hub-discovery**
129129
6. Click **idp2**
130-
7. Login as an an "expired" user: `username=`**already_past** `password=`**c**
130+
7. Login as an "expired" user: `username=`**already_past** `password=`**c**
131131

132132
### Multi-factor authentication (MFA) functionality
133133
#### Nag about missing MFA setup
@@ -137,7 +137,8 @@ If configured, an alert will be shown to the user filled with the content of tha
137137
4. Click **Test configured authentication sources**
138138
5. Click **hub-discovery**
139139
6. Click **idp4**
140-
7. TODO: add username and remaining steps
140+
7. Login as an "unprotected" user: `username=`**no_mfa_needed** `password=`**a**
141+
7. TODO: add remaining steps
141142

142143
#### Force MFA setup
143144
1. Goto [http://ssp-hub.local](http://ssp-hub.local)
@@ -146,7 +147,8 @@ If configured, an alert will be shown to the user filled with the content of tha
146147
4. Click **Test configured authentication sources**
147148
5. Click **hub-discovery**
148149
6. Click **idp4**
149-
7. TODO: add username and remaining steps
150+
7. Login as an "unsafe" user: `username=`**must_set_up_mfa** `password=`**a**
151+
7. TODO: add remaining steps
150152

151153
#### Backup code
152154
1. Goto [http://ssp-hub.local](http://ssp-hub.local)
@@ -155,7 +157,8 @@ If configured, an alert will be shown to the user filled with the content of tha
155157
4. Click **Test configured authentication sources**
156158
5. Click **hub-discovery**
157159
6. Click **idp4**
158-
7. TODO: add username and remaining steps
160+
7. Login as a "backup code" user: `username=`**has_backupcode** `password=`**a**
161+
7. TODO: add remaining steps
159162

160163
#### TOTP code
161164
1. Goto [http://ssp-hub.local](http://ssp-hub.local)
@@ -164,7 +167,8 @@ If configured, an alert will be shown to the user filled with the content of tha
164167
4. Click **Test configured authentication sources**
165168
5. Click **hub-discovery**
166169
6. Click **idp4**
167-
7. TODO: add username and remaining steps
170+
7. Login as a "totp" user: `username=`**has_totp** `password=`**a**
171+
7. TODO: add remaining steps
168172

169173
#### Key (U2F)
170174
1. Goto [http://ssp-hub.local](http://ssp-hub.local)
@@ -173,7 +177,8 @@ If configured, an alert will be shown to the user filled with the content of tha
173177
4. Click **Test configured authentication sources**
174178
5. Click **hub-discovery**
175179
6. Click **idp4**
176-
7. TODO: add username and remaining steps
180+
7. Login as a "u2f" user: `username=`**has_u2f** `password=`**a**
181+
7. TODO: add remaining steps
177182

178183
#### Multiple options
179184
1. Goto [http://ssp-hub.local](http://ssp-hub.local)
@@ -182,7 +187,8 @@ If configured, an alert will be shown to the user filled with the content of tha
182187
4. Click **Test configured authentication sources**
183188
5. Click **hub-discovery**
184189
6. Click **idp4**
185-
7. TODO: add username and remaining steps
190+
7. Login as a "multiple option" user: `username=`**has_all** `password=`**a**
191+
7. TODO: add remaining steps
186192

187193
### Announcements functionality
188194
1. Goto [http://ssp-hub2.local:8081](http://ssp-hub2.local:8081)
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<?php
2+
3+
use common\helpers\MySqlDateTime;
4+
use yii\db\Migration;
5+
6+
class m991231_235959_insert_mfa_test_users extends Migration
7+
{
8+
public function safeUp()
9+
{
10+
$this->batchInsert('{{user}}',
11+
['id','uuid' ,'employee_id','first_name','last_name','username' ,'email' ,'active','locked','last_changed_utc' ,'last_synced_utc' ,'require_mfa','nag_for_mfa_after' ],[
12+
[ 1 ,'2b2d424e-8cb0-49c7-8c0b-7f660340f5fa','11111' ,'Not' ,'Needed' ,'no_mfa_needed' ,'[email protected]' ,'yes' ,'no' , MySqlDateTime::now(), MySqlDateTime::now(),'no' , MySqlDateTime::today()],
13+
[ 2 ,'ef960c92-09fc-44f4-aadf-2d3aea6e0dbd','22222' ,'Must' ,'Have' ,'must_set_up_mfa','[email protected]','yes' ,'no' , MySqlDateTime::now(), MySqlDateTime::now(),'yes' , MySqlDateTime::today()],
14+
[ 3 ,'a42317a0-9a43-4da0-9921-50f004e011c0','33333' ,'Has' ,'Backup' ,'has_backupcode' ,'[email protected]' ,'yes' ,'no' , MySqlDateTime::now(), MySqlDateTime::now(),'no' , MySqlDateTime::today()],
15+
[ 4 ,'7bab90d3-9f54-4187-804d-7f6400021789','44444' ,'Has' ,'Totp' ,'has_totp' ,'[email protected]' ,'yes' ,'no' , MySqlDateTime::now(), MySqlDateTime::now(),'no' , MySqlDateTime::today()],
16+
[ 5 ,'6b614606-bbe8-4793-b0db-ca862295c661','55555' ,'Has' ,'U2f' ,'has_u2f' ,'[email protected]' ,'yes' ,'no' , MySqlDateTime::now(), MySqlDateTime::now(),'no' , MySqlDateTime::today()],
17+
[ 6 ,'7c695eac-dbca-45d0-b3dc-2df2e1d2294c','77777' ,'Has' ,'All' ,'has_all' ,'[email protected]' ,'yes' ,'no' , MySqlDateTime::now(), MySqlDateTime::now(),'no' , MySqlDateTime::today()],
18+
]);
19+
20+
$this->batchInsert('{{password}}',
21+
['id','user_id','hash' ,'created_utc' ,'expires_on','grace_period_ends_on'],[
22+
[ 1 , 1 ,'$2y$10$rKbAp0M8gewGpQKhD.U6qOSGDlMqKFkxK9tQZ15SZoieqYHYNsD/y', MySqlDateTime::now(),'9999-12-31','9999-12-31' ],
23+
[ 2 , 2 ,'$2y$10$rKbAp0M8gewGpQKhD.U6qOSGDlMqKFkxK9tQZ15SZoieqYHYNsD/y', MySqlDateTime::now(),'9999-12-31','9999-12-31' ],
24+
[ 3 , 3 ,'$2y$10$rKbAp0M8gewGpQKhD.U6qOSGDlMqKFkxK9tQZ15SZoieqYHYNsD/y', MySqlDateTime::now(),'9999-12-31','9999-12-31' ],
25+
[ 4 , 4 ,'$2y$10$rKbAp0M8gewGpQKhD.U6qOSGDlMqKFkxK9tQZ15SZoieqYHYNsD/y', MySqlDateTime::now(),'9999-12-31','9999-12-31' ],
26+
[ 5 , 5 ,'$2y$10$rKbAp0M8gewGpQKhD.U6qOSGDlMqKFkxK9tQZ15SZoieqYHYNsD/y', MySqlDateTime::now(),'9999-12-31','9999-12-31' ],
27+
[ 6 , 6 ,'$2y$10$rKbAp0M8gewGpQKhD.U6qOSGDlMqKFkxK9tQZ15SZoieqYHYNsD/y', MySqlDateTime::now(),'9999-12-31','9999-12-31' ],
28+
]);
29+
30+
$this->update('{{user}}', ['current_password_id' => 1], 'id=1');
31+
$this->update('{{user}}', ['current_password_id' => 2], 'id=2');
32+
$this->update('{{user}}', ['current_password_id' => 3], 'id=3');
33+
$this->update('{{user}}', ['current_password_id' => 4], 'id=4');
34+
$this->update('{{user}}', ['current_password_id' => 5], 'id=5');
35+
$this->update('{{user}}', ['current_password_id' => 6], 'id=6');
36+
37+
$this->batchInsert('{{mfa}}',
38+
['id','user_id','type' ,'verified','created_utc' ],[
39+
[ 1 , 3 ,'backupcode', 1 , MySqlDateTime::now()],
40+
[ 2 , 4 ,'totp' , 1 , MySqlDateTime::now()],
41+
[ 3 , 5 ,'u2f' , 1 , MySqlDateTime::now()],
42+
[ 4 , 6 ,'backupcode', 1 , MySqlDateTime::now()],
43+
[ 5 , 6 ,'totp' , 1 , MySqlDateTime::now()],
44+
[ 6 , 6 ,'u2f' , 1 , MySqlDateTime::now()],
45+
]);
46+
47+
$this->batchInsert('{{mfa_backupcode}}',
48+
['id','mfa_id','value' ,'created_utc' ],[
49+
[ 1 , 1 ,'$2y$10$j/V6zcotFES8MkVmgRaiMe2E6DV1qjmO8UhUoJQD0/.p6LhZddGn2', MySqlDateTime::now()], // 94923279
50+
[ 2 , 1 ,'$2y$10$If6srqyKGBag/x.nPDBeau9bjNR1RZgxqRVKhdRhJk2PkbOn5rKNS', MySqlDateTime::now()], // 82743523
51+
[ 3 , 1 ,'$2y$10$rA5MdrbEcmbCiqtAgPXnYeBCEKc.AnylPArnamyu.x4DS/A0/0/4i', MySqlDateTime::now()], // 77802769
52+
[ 4 , 1 ,'$2y$10$JsiRI/W/FLfZzJLPj8umKeXP.rvsOW4aYQO5mOEOwGkBPpKhKWT2K', MySqlDateTime::now()], // 01970541
53+
[ 5 , 1 ,'$2y$10$NWw0.DPBSm.bjQoSck8xbeqJgENUhE/WazmHmsEtWoxs/UKaIdkUq', MySqlDateTime::now()], // 37771076
54+
[ 6 , 1 ,'$2y$10$KE2849CaFCh4FNy61QfZfO5.3KIakJ0Ri.diDYrTA6DY5FUcUkiTS', MySqlDateTime::now()], // 39178450
55+
[ 7 , 1 ,'$2y$10$RqIdEzZ0t9dN6XEbCv9saeR91jmhhnAU0IygG2vbkToJtnjVvPOA.', MySqlDateTime::now()], // 01813404
56+
[ 8 , 1 ,'$2y$10$iiokti/0BscHBdId9GMDeeycdJUbhu3CySBptid4WjlT3ByYSITkq', MySqlDateTime::now()], // 00416843
57+
[ 9 , 1 ,'$2y$10$cICT0MhQ81/dEWYK/kY/LO2VMYvkoqd1/euP5OG7u5V6FRrSBEY6i', MySqlDateTime::now()], // 90068701
58+
[ 10 , 1 ,'$2y$10$OzQeTZlUGLOa0Q6Wm2zViuqV4CLzlkJxu8Sjli/v.JI0oYzj.B7um', MySqlDateTime::now()], // 35775442
59+
[ 11 , 4 ,'$2y$10$j/V6zcotFES8MkVmgRaiMe2E6DV1qjmO8UhUoJQD0/.p6LhZddGn2', MySqlDateTime::now()], // 94923279
60+
[ 12 , 4 ,'$2y$10$If6srqyKGBag/x.nPDBeau9bjNR1RZgxqRVKhdRhJk2PkbOn5rKNS', MySqlDateTime::now()], // 82743523
61+
[ 13 , 4 ,'$2y$10$rA5MdrbEcmbCiqtAgPXnYeBCEKc.AnylPArnamyu.x4DS/A0/0/4i', MySqlDateTime::now()], // 77802769
62+
[ 14 , 4 ,'$2y$10$JsiRI/W/FLfZzJLPj8umKeXP.rvsOW4aYQO5mOEOwGkBPpKhKWT2K', MySqlDateTime::now()], // 01970541
63+
[ 15 , 4 ,'$2y$10$NWw0.DPBSm.bjQoSck8xbeqJgENUhE/WazmHmsEtWoxs/UKaIdkUq', MySqlDateTime::now()], // 37771076
64+
[ 16 , 4 ,'$2y$10$KE2849CaFCh4FNy61QfZfO5.3KIakJ0Ri.diDYrTA6DY5FUcUkiTS', MySqlDateTime::now()], // 39178450
65+
[ 17 , 4 ,'$2y$10$RqIdEzZ0t9dN6XEbCv9saeR91jmhhnAU0IygG2vbkToJtnjVvPOA.', MySqlDateTime::now()], // 01813404
66+
[ 18 , 4 ,'$2y$10$iiokti/0BscHBdId9GMDeeycdJUbhu3CySBptid4WjlT3ByYSITkq', MySqlDateTime::now()], // 00416843
67+
[ 19 , 4 ,'$2y$10$cICT0MhQ81/dEWYK/kY/LO2VMYvkoqd1/euP5OG7u5V6FRrSBEY6i', MySqlDateTime::now()], // 90068701
68+
[ 20 , 4 ,'$2y$10$OzQeTZlUGLOa0Q6Wm2zViuqV4CLzlkJxu8Sjli/v.JI0oYzj.B7um', MySqlDateTime::now()], // 35775442
69+
]);
70+
}
71+
72+
public function safeDown()
73+
{
74+
$this->delete('{{mfa_backupcode}}', [
75+
'mfa_id' => [1, 4]
76+
]);
77+
$this->delete('{{mfa}}', [
78+
'user_id' => [3, 4, 5, 6]
79+
]);
80+
$this->delete('{{password}}', [
81+
'user_id' => [1, 2, 3, 4, 5, 6]
82+
]);
83+
84+
$this->delete('{{user}}', [
85+
'id' => [1, 2, 3, 4, 5, 6]
86+
]);
87+
}
88+
}

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ services:
131131

132132
broker:
133133
image: silintl/idp-id-broker:feature2sv #TODO: move this to :develop when PR'd
134+
volumes:
135+
- ./development/idp4/m991231_235959_insert_mfa_test_users.php:/data/console/migrations/m991231_235959_insert_mfa_test_users.php
134136
ports:
135137
- "8090:80"
136138
depends_on:

0 commit comments

Comments
 (0)