Code Duplication    Length = 14-14 lines in 4 locations

src/Surfnet/StepupGateway/SamlStepupProviderBundle/Saml/ProxyResponseFactory.php 1 location

@@ 108-121 (lines=14) @@
105
     * @param Assertion $newAssertion
106
     * @param string $destination
107
     */
108
    private function addSubjectConfirmationFor(Assertion $newAssertion, $destination)
109
    {
110
        $confirmation         = new SubjectConfirmation();
111
        $confirmation->Method = Constants::CM_BEARER;
112
113
        $confirmationData                      = new SubjectConfirmationData();
114
        $confirmationData->InResponseTo        = $this->stateHandler->getRequestId();
115
        $confirmationData->Recipient           = $destination;
116
        $confirmationData->NotOnOrAfter        = $newAssertion->getNotOnOrAfter();
117
118
        $confirmation->SubjectConfirmationData = $confirmationData;
119
120
        $newAssertion->setSubjectConfirmation([$confirmation]);
121
    }
122
123
    /**
124
     * @param Assertion $newAssertion

tests/src/Controller/IdentityProviderController.php 1 location

@@ 197-210 (lines=14) @@
194
        return $assertion;
195
    }
196
197
    private function addSubjectConfirmationFor(Assertion $newAssertion, $destination, $requestId)
198
    {
199
        $confirmation = new SubjectConfirmation();
200
        $confirmation->Method = Constants::CM_BEARER;
201
202
        $confirmationData                      = new SubjectConfirmationData();
203
        $confirmationData->InResponseTo        = $requestId;
204
        $confirmationData->Recipient           = $destination;
205
        $confirmationData->NotOnOrAfter        = $newAssertion->getNotOnOrAfter();
206
207
        $confirmation->SubjectConfirmationData = $confirmationData;
208
209
        $newAssertion->setSubjectConfirmation([$confirmation]);
210
    }
211
212
    /**
213
     * @return XMLSecurityKey

src/Surfnet/StepupGateway/GatewayBundle/Service/ProxyResponseService.php 1 location

@@ 143-156 (lines=14) @@
140
     * @param Assertion $newAssertion
141
     * @param string $destination ACS URL
142
     */
143
    private function addSubjectConfirmationFor(Assertion $newAssertion, $destination)
144
    {
145
        $confirmation         = new SubjectConfirmation();
146
        $confirmation->Method = Constants::CM_BEARER;
147
148
        $confirmationData                      = new SubjectConfirmationData();
149
        $confirmationData->InResponseTo        = $this->proxyStateHandler->getRequestId();
150
        $confirmationData->Recipient           = $destination;
151
        $confirmationData->NotOnOrAfter        = $newAssertion->getNotOnOrAfter();
152
153
        $confirmation->SubjectConfirmationData = $confirmationData;
154
155
        $newAssertion->setSubjectConfirmation([$confirmation]);
156
    }
157
158
    /**
159
     * @param Assertion $newAssertion

src/Surfnet/StepupGateway/SecondFactorOnlyBundle/Saml/ResponseFactory.php 1 location

@@ 131-144 (lines=14) @@
128
     * @param Assertion $newAssertion
129
     * @param string $destination The ACS location
130
     */
131
    private function addSubjectConfirmationFor(Assertion $newAssertion, $destination)
132
    {
133
        $confirmation         = new SubjectConfirmation();
134
        $confirmation->Method = Constants::CM_BEARER;
135
136
        $confirmationData                      = new SubjectConfirmationData();
137
        $confirmationData->InResponseTo        = $this->proxyStateHandler->getRequestId();
138
        $confirmationData->Recipient           = $destination;
139
        $confirmationData->NotOnOrAfter        = $newAssertion->getNotOnOrAfter();
140
141
        $confirmation->SubjectConfirmationData = $confirmationData;
142
143
        $newAssertion->setSubjectConfirmation([$confirmation]);
144
    }
145
146
    /**
147
     * @param Assertion $assertion