3939use Psr \Http \Message \StreamFactoryInterface ;
4040use Psr \Http \Message \UploadedFileFactoryInterface ;
4141use Symfony \Bridge \PsrHttpMessage \Factory \PsrHttpFactory ;
42+ use Symfony \Component \Serializer \SerializerInterface ;
4243use Webauthn \AttestationStatement \AndroidKeyAttestationStatementSupport ;
4344use Webauthn \AttestationStatement \AndroidSafetyNetAttestationStatementSupport ;
4445use Webauthn \AttestationStatement \AppleAttestationStatementSupport ;
5253use Webauthn \AuthenticatorAssertionResponseValidator ;
5354use Webauthn \AuthenticatorAttestationResponseValidator ;
5455use Webauthn \AuthenticatorSelectionCriteria ;
56+ use Webauthn \CeremonyStep \CeremonyStepManagerFactory ;
5557use Webauthn \Counter \CounterChecker ;
5658use Webauthn \Counter \ThrowExceptionIfInvalid ;
57- use Webauthn \PublicKeyCredentialLoader ;
5859use Webauthn \PublicKeyCredentialRpEntity ;
5960
6061class WebauthnServiceProvider extends ServiceProvider
@@ -188,15 +189,24 @@ protected function bindWebAuthnPackage(): void
188189 ), fn (AuthenticatorAttestationResponseValidator $ responseValidator ) => $ responseValidator ->setLogger ($ app ['webauthn.log ' ])
189190 )
190191 );
192+ $ this ->app ->bind (
193+ CeremonyStepManagerFactory::class,
194+ fn ($ app ) => tap (new CeremonyStepManagerFactory , function (CeremonyStepManagerFactory $ factory ) use ($ app ) {
195+ $ factory ->setExtensionOutputCheckerHandler ($ app [ExtensionOutputCheckerHandler::class]);
196+ $ factory ->setAlgorithmManager ($ app [CoseAlgorithmManager::class]);
197+ $ factory ->setCounterChecker ($ app [CounterChecker::class]);
198+ })
199+ );
191200 $ this ->app ->bind (
192201 AuthenticatorAssertionResponseValidator::class,
193202 fn ($ app ) => tap ((new AuthenticatorAssertionResponseValidator (
194203 null ,
195204 null ,
196205 $ app [ExtensionOutputCheckerHandler::class],
197- $ app [CoseAlgorithmManager::class]
198- ))
199- ->setCounterChecker ($ app [CounterChecker::class]), fn (AuthenticatorAssertionResponseValidator $ responseValidator ) => $ responseValidator ->setLogger ($ app ['webauthn.log ' ])
206+ $ app [CoseAlgorithmManager::class],
207+ null ,
208+ ($ app [CeremonyStepManagerFactory::class])->requestCeremony ()
209+ )), fn (AuthenticatorAssertionResponseValidator $ responseValidator ) => $ responseValidator ->setLogger ($ app ['webauthn.log ' ])
200210 )
201211 );
202212 $ this ->app ->bind (
@@ -207,7 +217,6 @@ protected function bindWebAuthnPackage(): void
207217 $ app ['config ' ]->get ('webauthn.userless ' )
208218 )
209219 );
210-
211220 $ this ->app ->bind (
212221 PublicKeyCredentialRpEntity::class,
213222 fn ($ app ) => new PublicKeyCredentialRpEntity (
@@ -216,14 +225,6 @@ protected function bindWebAuthnPackage(): void
216225 $ app ['config ' ]->get ('webauthn.icon ' )
217226 )
218227 );
219- $ this ->app ->bind (
220- PublicKeyCredentialLoader::class,
221- fn ($ app ) => tap (new PublicKeyCredentialLoader (
222- $ app [AttestationObjectLoader::class]
223- ), fn (PublicKeyCredentialLoader $ loader ) => $ loader ->setLogger ($ app ['webauthn.log ' ])
224- )
225- );
226-
227228 $ this ->app ->bind (
228229 CoseAlgorithmManager::class,
229230 fn ($ app ) => $ app [CoseAlgorithmManagerFactory::class]
@@ -256,6 +257,10 @@ protected function bindWebAuthnPackage(): void
256257 }
257258 })
258259 );
260+ $ this ->app ->bind (
261+ SerializerInterface::class,
262+ fn ($ app ) => (new \Webauthn \Denormalizer \WebauthnSerializerFactory ($ app [AttestationStatementSupportManager::class]))->create ()
263+ );
259264 }
260265
261266 /**
0 commit comments