@@ -571,17 +571,17 @@ discard block |
||
571 | 571 | } |
572 | 572 | |
573 | 573 | $metadata = array("service"=> |
574 | - array("displayName" => $this->_name, |
|
575 | - "identifier" => $this->_identifier, |
|
576 | - "logoUrl" => $this->_logoUrl, |
|
577 | - "infoUrl" => $this->_infoUrl, |
|
578 | - "authenticationUrl" => $authenticationUrl, |
|
579 | - "ocraSuite" => $this->_ocraSuite, |
|
580 | - "enrollmentUrl" => $enrollmentUrl |
|
581 | - ), |
|
582 | - "identity"=> |
|
583 | - array("identifier" =>$data["userId"], |
|
584 | - "displayName"=>$data["displayName"])); |
|
574 | + array("displayName" => $this->_name, |
|
575 | + "identifier" => $this->_identifier, |
|
576 | + "logoUrl" => $this->_logoUrl, |
|
577 | + "infoUrl" => $this->_infoUrl, |
|
578 | + "authenticationUrl" => $authenticationUrl, |
|
579 | + "ocraSuite" => $this->_ocraSuite, |
|
580 | + "enrollmentUrl" => $enrollmentUrl |
|
581 | + ), |
|
582 | + "identity"=> |
|
583 | + array("identifier" =>$data["userId"], |
|
584 | + "displayName"=>$data["displayName"])); |
|
585 | 585 | |
586 | 586 | $this->_unsetStateValue(self::PREFIX_ENROLLMENT, $enrollmentKey); |
587 | 587 | |
@@ -611,28 +611,28 @@ discard block |
||
611 | 611 | */ |
612 | 612 | public function getEnrollmentSecret(string $enrollmentKey): string |
613 | 613 | { |
614 | - $data = $this->_getStateValue(self::PREFIX_ENROLLMENT, $enrollmentKey); |
|
615 | - if (!is_array($data)) { |
|
616 | - $this->logger->error('getEnrollmentSecret: enrollment key not found'); |
|
617 | - throw new RuntimeException('enrollment key not found'); |
|
618 | - } |
|
619 | - $userId = $data["userId"] ?? NULL; |
|
620 | - $sessionId = $data["sessionId"] ?? NULL; |
|
621 | - if (!is_string($userId) || !(is_string($sessionId))) { |
|
622 | - throw new RuntimeException('getEnrollmentSecret: invalid enrollment data'); |
|
623 | - } |
|
624 | - $enrollmentData = [ |
|
625 | - "userId" => $userId, |
|
626 | - "sessionId" => $sessionId |
|
627 | - ]; |
|
628 | - $enrollmentSecret = $this->_uniqueSessionKey(); |
|
629 | - $this->_setStateValue( |
|
630 | - self::PREFIX_ENROLLMENT_SECRET, |
|
631 | - $enrollmentSecret, |
|
632 | - $enrollmentData, |
|
633 | - self::ENROLLMENT_EXPIRE |
|
634 | - ); |
|
635 | - return $enrollmentSecret; |
|
614 | + $data = $this->_getStateValue(self::PREFIX_ENROLLMENT, $enrollmentKey); |
|
615 | + if (!is_array($data)) { |
|
616 | + $this->logger->error('getEnrollmentSecret: enrollment key not found'); |
|
617 | + throw new RuntimeException('enrollment key not found'); |
|
618 | + } |
|
619 | + $userId = $data["userId"] ?? NULL; |
|
620 | + $sessionId = $data["sessionId"] ?? NULL; |
|
621 | + if (!is_string($userId) || !(is_string($sessionId))) { |
|
622 | + throw new RuntimeException('getEnrollmentSecret: invalid enrollment data'); |
|
623 | + } |
|
624 | + $enrollmentData = [ |
|
625 | + "userId" => $userId, |
|
626 | + "sessionId" => $sessionId |
|
627 | + ]; |
|
628 | + $enrollmentSecret = $this->_uniqueSessionKey(); |
|
629 | + $this->_setStateValue( |
|
630 | + self::PREFIX_ENROLLMENT_SECRET, |
|
631 | + $enrollmentSecret, |
|
632 | + $enrollmentData, |
|
633 | + self::ENROLLMENT_EXPIRE |
|
634 | + ); |
|
635 | + return $enrollmentSecret; |
|
636 | 636 | } |
637 | 637 | |
638 | 638 | /** |
@@ -30,13 +30,11 @@ |
||
30 | 30 | notificationtype varchar(10), |
31 | 31 | notificationaddress varchar(64) |
32 | 32 | ); |
33 | - |
|
34 | 33 | * |
35 | 34 | * In version 3.0 the format of the tmpblocktimestamp was changed from a datetime format to an integer. |
36 | 35 | * Because it holds a unix timestamp a 64-bit (8-byte) integer. To upgrade the user table to the new format use: |
37 | 36 | |
38 | 37 | ALTER TABLE user MODIFY tmpblocktimestamp BIGINT; |
39 | - |
|
40 | 38 | */ |
41 | 39 | |
42 | 40 | use Psr\Log\LoggerInterface; |