平衡平台SCA网络
这个图书馆提供了一种与 强有力的客户授权。此图书馆基于 网络认证 保证行动的安全.
安装
您可以在浏览器上使用此库 deraclty , 或者您可以添加对您的依赖 JS 项目.
与 无 对
npm install @adyen/bpscaweb
与 浏览器 对
<script type="module" src="bpscaweb.es.js"></script>
<script type="module">
import ScaWebauthn from '/js/bpscaweb.es.js';
...
</script>
在你身边 TS 翻译 项目执行
import ScaWebauthn from '@adyen/bpscaweb';
配置
一旦安装了组件,您就可以在创建新组件时配置它 处理器。 。 。 .
const handler = ScaWebauthn.create(options);
选项
这些是您可以传递给组件的选项
| 选项 | 需求 | 类型 | 说明 |
|---|---|---|---|
| 依赖 派对Name | 对 | 字符串 | 代表依赖方名称的字符串 。 这是用户在创建或验证WebAuthn操作时将呈现的名称 . |
示例: 创建处理器
const scaWebauthn = ScaWebauthn.create({
relyingPartyName: 'adyen_bpsca',
});
检查可用性
检查设备上是否有 SCA .
const sdkOutput = await scaWebauthn.checkAvailability();
注册设备
交换 sdkInput 在启动寄存器呼叫中的后端返回
const sdkOutput = await scaWebauthn.register(sdkInput); // the new output that will be shared with the server to complete the registration
认证设备
交换 sdkInput 由第一个呼叫中的后端返回
const sdkOutput = await scaWebauthn.authenticate(sdkInput); // the new output that will be shared with the server to authenticate the call