@@ -117,20 +117,20 @@ public function test_do_authenticate()
117117 $ this ->assertInstanceOf (\Webauthn \PublicKeyCredentialRequestOptions::class, $ publicKey );
118118
119119 $ data = [
120- 'id ' => Base64UrlSafe::encode ($ webauthnKey ->credentialId ),
120+ 'id ' => Base64UrlSafe::encodeUnpadded ($ webauthnKey ->credentialId ),
121121 'rawId ' => Base64UrlSafe::encode ($ webauthnKey ->credentialId ),
122122 'type ' => 'public-key ' ,
123123 'response ' => [
124- 'clientDataJSON ' => Base64UrlSafe::encode (json_encode ([
124+ 'clientDataJSON ' => Base64UrlSafe::encodeUnpadded (json_encode ([
125125 'type ' => 'webauthn.get ' ,
126- 'challenge ' => Base64UrlSafe::encode ($ publicKey ->getChallenge ()),
126+ 'challenge ' => Base64UrlSafe::encodeUnpadded ($ publicKey ->getChallenge ()),
127127 'origin ' => 'https://localhost ' ,
128128 'tokenBinding ' => [
129129 'status ' => 'supported ' ,
130130 'id ' => 'id ' ,
131131 ],
132132 ])),
133- 'authenticatorData ' => Base64UrlSafe::encode (
133+ 'authenticatorData ' => Base64UrlSafe::encodeUnpadded (
134134 hash ('sha256 ' , 'localhost ' , true ). // rp_id_hash
135135 pack ('C ' , 65 ). // flags
136136 pack ('N ' , 1 ). // signCount
@@ -176,20 +176,20 @@ public function test_wrong_do_authenticate()
176176 private function getAttestationData ($ publicKey )
177177 {
178178 return [
179- 'id ' => Base64UrlSafe::encode ('0 ' ),
179+ 'id ' => Base64UrlSafe::encodeUnpadded ('0 ' ),
180180 'rawId ' => Base64UrlSafe::encode ('0 ' ),
181181 'type ' => 'public-key ' ,
182182 'response ' => [
183- 'clientDataJSON ' => Base64UrlSafe::encode (json_encode ([
183+ 'clientDataJSON ' => Base64UrlSafe::encodeUnpadded (json_encode ([
184184 'type ' => 'webauthn.create ' ,
185- 'challenge ' => Base64UrlSafe::encode ($ publicKey ->getChallenge ()),
185+ 'challenge ' => Base64UrlSafe::encodeUnpadded ($ publicKey ->getChallenge ()),
186186 'origin ' => 'https://localhost ' ,
187187 'tokenBinding ' => [
188188 'status ' => 'supported ' ,
189189 'id ' => 'id ' ,
190190 ],
191191 ])),
192- 'attestationObject ' => Base64UrlSafe::encode ((string ) (new MapObject ([
192+ 'attestationObject ' => Base64UrlSafe::encodeUnpadded ((string ) (new MapObject ([
193193 new MapItem (
194194 new TextStringObject ('authData ' ),
195195 new TextStringObject (
0 commit comments