arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

Dealing with “localhost”

aka non-https relying parties

hashtag
Secured Context

If your are working on a development environment, https may not be available but the context could be considered as secured. You can bypass the scheme verification by passing the list of rpIds you consider secured.

triangle-exclamation

Please be careful using this feature. It should NOT be used in production.

hashtag
The Easy Way

hashtag
The Hard Way

hashtag
The Symfony Way

$server->setSecuredRelyingPartyId(['localhost']);
$publicKeyCredentialSource = $authenticatorAttestationResponseValidator->check(
    $authenticatorAttestationResponse,
    $publicKeyCredentialCreationOptions,
    $serverRequest,
    ['localhost']
);
$publicKeyCredentialSource = $authenticatorAssertionResponse->check(
    $publicKeyCredential->getRawId(),
    $authenticatorAssertionResponse,
    $publicKeyCredentialRequestOptions,
    $request,
    $userHandle,
    ['localhost']
);
security:
    firewalls:
        main:
            webauthn:
               secured_rp_ids:
                   - 'localhost'