blob: 86ff8dc6bdc66702272cde449368831b472b81b5 [file] [log] [blame]
<!DOCTYPE HTML>
<script src="/gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script>
<script src="/gen/third_party/WebKit/public/platform/modules/credentialmanager/credential_manager.mojom.js"></script>
<script src="/gen/third_party/WebKit/public/platform/modules/webauth/authenticator.mojom.js"></script>
<script src="credential-helpers.js"></script>
<script>
mockAuthenticator.setRawId(RAW_ID);
mockAuthenticator.setId(ID);
mockAuthenticator.setClientDataJson(CLIENT_DATA_JSON);
mockAuthenticator.setAuthenticatorData(AUTHENTICATOR_DATA);
mockAuthenticator.setSignature(SIGNATURE);
mockAuthenticator.setAuthenticatorStatus(
webauth.mojom.AuthenticatorStatus.SUCCESS);
let queryParams = new URLSearchParams(window.location.search);
let relyingPartyId = queryParams.get('rpId');
var customPublicKey = {
challenge: CHALLENGE,
rpId: relyingPartyId,
allowCredentials: [ACCEPTABLE_CREDENTIAL]
};
navigator.credentials.get({publicKey : customPublicKey})
.then(r => window.opener.postMessage("SUCCESS", "*"))
.catch(t => window.opener.postMessage(t.name, "*"));
</script>