|
@@ 189-206 (lines=18) @@
|
| 186 |
|
$this->eventSourcedRepository->save($identity); |
| 187 |
|
} |
| 188 |
|
|
| 189 |
|
public function handleProveYubikeyPossessionCommand(ProveYubikeyPossessionCommand $command) |
| 190 |
|
{ |
| 191 |
|
/** @var IdentityApi $identity */ |
| 192 |
|
$identity = $this->eventSourcedRepository->load(new IdentityId($command->identityId)); |
| 193 |
|
|
| 194 |
|
$identity->setMaxNumberOfTokens($this->numberOfTokensPerIdentity); |
| 195 |
|
|
| 196 |
|
$this->assertSecondFactorIsAllowedFor(new SecondFactorType('yubikey'), $identity->getInstitution()); |
| 197 |
|
|
| 198 |
|
$identity->provePossessionOfYubikey( |
| 199 |
|
new SecondFactorId($command->secondFactorId), |
| 200 |
|
new YubikeyPublicId($command->yubikeyPublicId), |
| 201 |
|
$this->emailVerificationIsRequired($identity), |
| 202 |
|
$this->configurableSettings->createNewEmailVerificationWindow() |
| 203 |
|
); |
| 204 |
|
|
| 205 |
|
$this->eventSourcedRepository->save($identity); |
| 206 |
|
} |
| 207 |
|
|
| 208 |
|
/** |
| 209 |
|
* @param ProvePhonePossessionCommand $command |
|
@@ 211-228 (lines=18) @@
|
| 208 |
|
/** |
| 209 |
|
* @param ProvePhonePossessionCommand $command |
| 210 |
|
*/ |
| 211 |
|
public function handleProvePhonePossessionCommand(ProvePhonePossessionCommand $command) |
| 212 |
|
{ |
| 213 |
|
/** @var IdentityApi $identity */ |
| 214 |
|
$identity = $this->eventSourcedRepository->load(new IdentityId($command->identityId)); |
| 215 |
|
|
| 216 |
|
$this->assertSecondFactorIsAllowedFor(new SecondFactorType('sms'), $identity->getInstitution()); |
| 217 |
|
|
| 218 |
|
$identity->setMaxNumberOfTokens($this->numberOfTokensPerIdentity); |
| 219 |
|
|
| 220 |
|
$identity->provePossessionOfPhone( |
| 221 |
|
new SecondFactorId($command->secondFactorId), |
| 222 |
|
new PhoneNumber($command->phoneNumber), |
| 223 |
|
$this->emailVerificationIsRequired($identity), |
| 224 |
|
$this->configurableSettings->createNewEmailVerificationWindow() |
| 225 |
|
); |
| 226 |
|
|
| 227 |
|
$this->eventSourcedRepository->save($identity); |
| 228 |
|
} |
| 229 |
|
|
| 230 |
|
/** |
| 231 |
|
* @param ProveGssfPossessionCommand $command |
|
@@ 233-252 (lines=20) @@
|
| 230 |
|
/** |
| 231 |
|
* @param ProveGssfPossessionCommand $command |
| 232 |
|
*/ |
| 233 |
|
public function handleProveGssfPossessionCommand(ProveGssfPossessionCommand $command) |
| 234 |
|
{ |
| 235 |
|
/** @var IdentityApi $identity */ |
| 236 |
|
$identity = $this->eventSourcedRepository->load(new IdentityId($command->identityId)); |
| 237 |
|
|
| 238 |
|
// Assume tiqr is being used as it is the only GSSF currently supported |
| 239 |
|
$this->assertSecondFactorIsAllowedFor(new SecondFactorType('tiqr'), $identity->getInstitution()); |
| 240 |
|
|
| 241 |
|
$identity->setMaxNumberOfTokens($this->numberOfTokensPerIdentity); |
| 242 |
|
|
| 243 |
|
$identity->provePossessionOfGssf( |
| 244 |
|
new SecondFactorId($command->secondFactorId), |
| 245 |
|
new StepupProvider($command->stepupProvider), |
| 246 |
|
new GssfId($command->gssfId), |
| 247 |
|
$this->emailVerificationIsRequired($identity), |
| 248 |
|
$this->configurableSettings->createNewEmailVerificationWindow() |
| 249 |
|
); |
| 250 |
|
|
| 251 |
|
$this->eventSourcedRepository->save($identity); |
| 252 |
|
} |
| 253 |
|
|
| 254 |
|
public function handleProveU2fDevicePossessionCommand(ProveU2fDevicePossessionCommand $command) |
| 255 |
|
{ |
|
@@ 254-271 (lines=18) @@
|
| 251 |
|
$this->eventSourcedRepository->save($identity); |
| 252 |
|
} |
| 253 |
|
|
| 254 |
|
public function handleProveU2fDevicePossessionCommand(ProveU2fDevicePossessionCommand $command) |
| 255 |
|
{ |
| 256 |
|
/** @var IdentityApi $identity */ |
| 257 |
|
$identity = $this->eventSourcedRepository->load(new IdentityId($command->identityId)); |
| 258 |
|
|
| 259 |
|
$this->assertSecondFactorIsAllowedFor(new SecondFactorType('u2f'), $identity->getInstitution()); |
| 260 |
|
|
| 261 |
|
$identity->setMaxNumberOfTokens($this->numberOfTokensPerIdentity); |
| 262 |
|
|
| 263 |
|
$identity->provePossessionOfU2fDevice( |
| 264 |
|
new SecondFactorId($command->secondFactorId), |
| 265 |
|
new U2fKeyHandle($command->keyHandle), |
| 266 |
|
$this->emailVerificationIsRequired($identity), |
| 267 |
|
$this->configurableSettings->createNewEmailVerificationWindow() |
| 268 |
|
); |
| 269 |
|
|
| 270 |
|
$this->eventSourcedRepository->save($identity); |
| 271 |
|
} |
| 272 |
|
|
| 273 |
|
/** |
| 274 |
|
* @param VerifyEmailCommand $command |