Git Product home page Git Product logo

Comments (4)

willbrowningme avatar willbrowningme commented on August 24, 2024

Adding the following to AppServiceProvider (and importing classes) works:

$this->app->bind(
    AttestationObjectLoader::class,
    fn ($app) => (new AttestationObjectLoader(
            $app[AttestationStatementSupportManager::class]
        ))
            ->setLogger(new NullLogger())
);
$this->app->bind(
    AuthenticatorAttestationResponseValidator::class,
    fn ($app) => (new AuthenticatorAttestationResponseValidator(
            $app[AttestationStatementSupportManager::class],
            $app[PublicKeyCredentialSourceRepository::class],
            $app[TokenBindingHandler::class],
            $app[ExtensionOutputCheckerHandler::class]
        ))
        ->setLogger(new NullLogger())
);
$this->app->bind(
    AuthenticatorAssertionResponseValidator::class,
    fn ($app) => (new AuthenticatorAssertionResponseValidator(
            $app[PublicKeyCredentialSourceRepository::class],
            $app[TokenBindingHandler::class],
            $app[ExtensionOutputCheckerHandler::class],
            $app[CoseAlgorithmManager::class]
        ))
        ->setCounterChecker($app[CounterChecker::class])
        ->setLogger(new NullLogger())
);
$this->app->bind(
    PublicKeyCredentialLoader::class,
    fn ($app) => (new PublicKeyCredentialLoader(
            $app[AttestationObjectLoader::class]
        ))
            ->setLogger(new NullLogger())
);

from laravel-webauthn.

MordiSacks avatar MordiSacks commented on August 24, 2024

@willbrowningme I couldn't find the class CoseAlgorithmManager

from laravel-webauthn.

MordiSacks avatar MordiSacks commented on August 24, 2024

Ok I found it in the service provider of this package, Thank you very much
Here are more detailed instructions

in AppServiceProvider import

use Psr\Log\NullLogger;
use Webauthn\AttestationStatement\AttestationObjectLoader;
use Webauthn\AttestationStatement\AttestationStatementSupportManager;
use Webauthn\AuthenticationExtensions\ExtensionOutputCheckerHandler;
use Webauthn\AuthenticatorAssertionResponseValidator;
use Webauthn\AuthenticatorAttestationResponseValidator;
use Webauthn\Counter\CounterChecker;
use Webauthn\PublicKeyCredentialLoader;
use Webauthn\PublicKeyCredentialSourceRepository;
use Webauthn\TokenBinding\TokenBindingHandler;
use Cose\Algorithm\Manager as CoseAlgorithmManager;

then add this method

private function disableWebauthnLog()
    {
        $this->app->bind(AttestationObjectLoader::class,
            fn($x) => (new AttestationObjectLoader($x[AttestationStatementSupportManager::class]))
                ->setLogger(new NullLogger())
        );

        $this->app->bind(AuthenticatorAttestationResponseValidator::class,
            fn($x) => (new AuthenticatorAttestationResponseValidator(
                $x[AttestationStatementSupportManager::class],
                $x[PublicKeyCredentialSourceRepository::class],
                $x[TokenBindingHandler::class],
                $x[ExtensionOutputCheckerHandler::class]
            ))->setLogger(new NullLogger())
        );

        $this->app->bind(AuthenticatorAssertionResponseValidator::class,
            fn($x) => (new AuthenticatorAssertionResponseValidator(
                $x[PublicKeyCredentialSourceRepository::class],
                $x[TokenBindingHandler::class],
                $x[ExtensionOutputCheckerHandler::class],
                $x[CoseAlgorithmManager::class]
            ))->setCounterChecker($x[CounterChecker::class])->setLogger(new NullLogger())
        );

        $this->app->bind(PublicKeyCredentialLoader::class,
            fn($x) => (new PublicKeyCredentialLoader($x[AttestationObjectLoader::class]))
                ->setLogger(new NullLogger())
        );
    }

then call the method in the register method

Thank you @willbrowningme

from laravel-webauthn.

willbrowningme avatar willbrowningme commented on August 24, 2024

You can now just add:

'log' => 'null',

to your config/webauthn.php to disable logging.

from laravel-webauthn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.