reCaptcha v3 handle score callback

后端 未结 3 2087
天涯浪人
天涯浪人 2020-12-07 01:15

I followed recaptcha v3 example and managed to make it return a callback with a score for a page, similar with their demo.

What I don\'t understand is how to

3条回答
  •  北海茫月
    2020-12-07 01:40

    Unfortunately, recaptcha v3 does not have challenge methods, which means we need to handle the score threshold in our own server side.

    The best solution would be that apply both v2 and v3 together, e.g. if v3 fails threshold, then it pops up v2 challenge. The official site suggests to use 2-way authentication e.g. SMS. However, I don't think 70% of people would do it.

    I have created a composer package for Laravel framework which supports score settings. You can check the source code in github recaptcha:

    You can do score comparison for your own score handler.

    The basic usage would be like:

    {!!  GoogleReCaptchaV3::requireJs() !!} 
    
    @csrf {!! GoogleReCaptchaV3::render('contact_us') !!}

提交回复
热议问题