@@ -117,9 +117,9 @@ public function getProxyGrantingTicketIOU(): ?string
117117
118118 /**
119119 * @param string $username
120- * @return \SimpleSAML\CAS\XML\cas\AuthenticationSuccess
120+ * @return \SimpleSAML\CAS\XML\cas\ServiceResponse
121121 */
122- public function getValidateSuccessResponse (string $ username ): AuthenticationSuccess
122+ public function getValidateSuccessResponse (string $ username ): ServiceResponse
123123 {
124124 $ user = new User ($ username );
125125
@@ -157,9 +157,10 @@ public function getValidateSuccessResponse(string $username): AuthenticationSucc
157157 $ attr ,
158158 );
159159
160- $ authenticationSucces = new AuthenticationSuccess ($ user , $ attributes , $ proxyGrantingTicket );
160+ $ authenticationSuccess = new AuthenticationSuccess ($ user , $ attributes , $ proxyGrantingTicket );
161+ $ serviceResponse = new ServiceResponse ($ authenticationSuccess );
161162
162- return $ authenticationSucces ;
163+ return $ serviceResponse ;
163164 }
164165
165166
@@ -217,8 +218,7 @@ private function generateCas20Attribute(
217218 $ xmlDocument = DOMDocumentFactory::create ();
218219
219220 $ attributeValue = $ this ->base64EncodeAttributes ? base64_encode ($ attributeValue ) : $ attributeValue ;
220- $ attributeElement = $ xmlDocument ->createElement ('cas: ' . $ attributeName );
221- $ attributeElement ->appendChild ($ attributeValueNode );
221+ $ attributeElement = $ xmlDocument ->createElementNS (Attributes::NS , 'cas: ' . $ attributeName , $ attributeValue );
222222
223223 return new Chunk ($ attributeElement );
224224 }
@@ -242,6 +242,6 @@ private function isValidXmlName(string $name): bool
242242 $ name ,
243243 FILTER_VALIDATE_REGEXP ,
244244 ['options ' => ['regexp ' => '/^[a-zA-Z_][\w.-]*$/ ' ]],
245- ) === true ;
245+ ) !== false ;
246246 }
247247}
0 commit comments