Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@simplewebauthn/browser

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@simplewebauthn/browser - npm Package Compare versions

Comparing version 0.4.0 to 0.5.0

dist/helpers/base64URLStringToBuffer.d.ts

5

dist/index.d.ts

@@ -0,1 +1,6 @@

/**
* @packageDocumentation
* @module @simplewebauthn/browser
* @preferred
*/
import startAttestation from './methods/startAttestation';

@@ -2,0 +7,0 @@ import startAssertion from './methods/startAssertion';

4

dist/methods/startAssertion.d.ts

@@ -1,2 +0,2 @@

import { PublicKeyCredentialRequestOptionsJSON, AuthenticatorAssertionResponseJSON } from '@simplewebauthn/typescript-types';
import { PublicKeyCredentialRequestOptionsJSON, AssertionCredentialJSON } from '@simplewebauthn/typescript-types';
/**

@@ -7,2 +7,2 @@ * Begin authenticator "login" via WebAuthn assertion

*/
export default function startAssertion(requestOptionsJSON: PublicKeyCredentialRequestOptionsJSON): Promise<AuthenticatorAssertionResponseJSON>;
export default function startAssertion(requestOptionsJSON: PublicKeyCredentialRequestOptionsJSON): Promise<AssertionCredentialJSON>;

@@ -1,2 +0,2 @@

import { PublicKeyCredentialCreationOptionsJSON, AuthenticatorAttestationResponseJSON } from '@simplewebauthn/typescript-types';
import { PublicKeyCredentialCreationOptionsJSON, AttestationCredentialJSON } from '@simplewebauthn/typescript-types';
/**

@@ -7,2 +7,2 @@ * Begin authenticator "registration" via WebAuthn attestation

*/
export default function startAttestation(creationOptionsJSON: PublicKeyCredentialCreationOptionsJSON): Promise<AuthenticatorAttestationResponseJSON>;
export default function startAttestation(creationOptionsJSON: PublicKeyCredentialCreationOptionsJSON): Promise<AttestationCredentialJSON>;

@@ -1,3 +0,3 @@

// [@webauthentine/browser] Version: 0.4.0 - Tuesday, May 26th, 2020, 10:39:23 PM
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SimpleWebAuthnBrowser=t():e.SimpleWebAuthnBrowser=t()}(this,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}([function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return void 0!==(null===window||void 0===window?void 0:window.PublicKeyCredential)&&"function"==typeof window.PublicKeyCredential}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return Uint8Array.from(e,e=>e.charCodeAt(0))}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(3));t.default=function(e){return o.default.fromByteArray(new Uint8Array(e)).replace(/\+/g,"-").replace(/\//g,"_")}},function(e,t,r){"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=s(e),a=n[0],i=n[1],l=new u(function(e,t,r){return 3*(t+r)/4-r}(0,a,i)),d=0,f=i>0?a-4:a;for(r=0;r<f;r+=4)t=o[e.charCodeAt(r)]<<18|o[e.charCodeAt(r+1)]<<12|o[e.charCodeAt(r+2)]<<6|o[e.charCodeAt(r+3)],l[d++]=t>>16&255,l[d++]=t>>8&255,l[d++]=255&t;2===i&&(t=o[e.charCodeAt(r)]<<2|o[e.charCodeAt(r+1)]>>4,l[d++]=255&t);1===i&&(t=o[e.charCodeAt(r)]<<10|o[e.charCodeAt(r+1)]<<4|o[e.charCodeAt(r+2)]>>2,l[d++]=t>>8&255,l[d++]=255&t);return l},t.fromByteArray=function(e){for(var t,r=e.length,o=r%3,u=[],a=0,i=r-o;a<i;a+=16383)u.push(d(e,a,a+16383>i?i:a+16383));1===o?(t=e[r-1],u.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[r-2]<<8)+e[r-1],u.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return u.join("")};for(var n=[],o=[],u="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,l=a.length;i<l;++i)n[i]=a[i],o[a.charCodeAt(i)]=i;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function d(e,t,r){for(var o,u,a=[],i=t;i<r;i+=3)o=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),a.push(n[(u=o)>>18&63]+n[u>>12&63]+n[u>>6&63]+n[63&u]);return a.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(3));t.default=function(e){const{id:t}=e,r=4-t.length%4,n=t.padEnd(t.length+r,"=");return{...e,id:o.default.toByteArray(n)}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.supportsWebauthn=t.startAssertion=t.startAttestation=void 0;const o=n(r(6));t.startAttestation=o.default;const u=n(r(7));t.startAssertion=u.default;const a=n(r(0));t.supportsWebauthn=a.default},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(1)),u=n(r(2)),a=n(r(0)),i=n(r(4));t.default=async function(e){if(!a.default())throw new Error("WebAuthn is not supported in this browser");const t={...e,challenge:o.default(e.challenge),user:{...e.user,id:o.default(e.user.id)},excludeCredentials:e.excludeCredentials.map(i.default)},r=await navigator.credentials.create({publicKey:t});if(!r)throw new Error("Attestation was not completed");const{response:n}=r;return{base64AttestationObject:u.default(n.attestationObject),base64ClientDataJSON:u.default(n.clientDataJSON)}}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(1)),u=n(r(2)),a=n(r(0)),i=n(r(4));t.default=async function(e){if(!a.default())throw new Error("WebAuthn is not supported in this browser");const t={...e,challenge:o.default(e.challenge),allowCredentials:e.allowCredentials.map(i.default)},r=await navigator.credentials.get({publicKey:t});if(!r)throw new Error("Assertion was not completed");const{response:n}=r;let l=void 0;return n.userHandle&&(l=u.default(n.userHandle)),{base64CredentialID:r.id,base64AuthenticatorData:u.default(n.authenticatorData),base64ClientDataJSON:u.default(n.clientDataJSON),base64Signature:u.default(n.signature),base64UserHandle:l}}}])}));
// [@webauthentine/browser] Version: 0.5.0 - Tuesday, June 2nd, 2020, 3:51:14 PM
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SimpleWebAuthnBrowser=t():e.SimpleWebAuthnBrowser=t()}(this,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return void 0!==(null===window||void 0===window?void 0:window.PublicKeyCredential)&&"function"==typeof window.PublicKeyCredential}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return Uint8Array.from(e,e=>e.charCodeAt(0))}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=new Uint8Array(e);let n="";for(const e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(6));t.default=function(e){const{id:t}=e;return{...e,id:o.default(t)}}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.supportsWebauthn=t.startAssertion=t.startAttestation=void 0;const o=r(n(5));t.startAttestation=o.default;const u=r(n(7));t.startAssertion=u.default;const a=r(n(0));t.supportsWebauthn=a.default},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(1)),u=r(n(2)),a=r(n(0)),i=r(n(3));t.default=async function(e){if(!a.default())throw new Error("WebAuthn is not supported in this browser");const t={...e,challenge:o.default(e.challenge),user:{...e.user,id:o.default(e.user.id)},excludeCredentials:e.excludeCredentials.map(i.default)},n=await navigator.credentials.create({publicKey:t});if(!n)throw new Error("Attestation was not completed");const{id:r,rawId:l,response:s,type:d}=n;return{id:r,rawId:u.default(l),response:{attestationObject:u.default(s.attestationObject),clientDataJSON:u.default(s.clientDataJSON)},type:d}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,"="),o=atob(r),u=new ArrayBuffer(o.length),a=new Uint8Array(u);for(let e=0;e<o.length;e++)a[e]=o.charCodeAt(e);return u}},function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=r(n(1)),u=r(n(2)),a=r(n(0)),i=r(n(3));t.default=async function(e){if(!a.default())throw new Error("WebAuthn is not supported in this browser");const t={...e,challenge:o.default(e.challenge),allowCredentials:e.allowCredentials.map(i.default)},n=await navigator.credentials.get({publicKey:t});if(!n)throw new Error("Assertion was not completed");const{id:r,rawId:l,response:s,type:d}=n;let c=void 0;return s.userHandle&&(c=u.default(s.userHandle)),{id:r,rawId:u.default(l),response:{authenticatorData:u.default(s.authenticatorData),clientDataJSON:u.default(s.clientDataJSON),signature:u.default(s.signature),userHandle:c},type:d}}}])}));
//# sourceMappingURL=simplewebauthn-browser.min.js.map
{
"name": "@simplewebauthn/browser",
"version": "0.4.0",
"version": "0.5.0",
"description": "SimpleWebAuthn for Browsers",

@@ -25,8 +25,4 @@ "main": "dist/simplewebauthn-browser.min.js",

],
"dependencies": {
"base64-js": "^1.3.1"
},
"devDependencies": {
"@simplewebauthn/typescript-types": "^0.4.0",
"@types/base64-js": "^1.2.5",
"@simplewebauthn/typescript-types": "^0.5.0",
"ts-loader": "^7.0.4",

@@ -37,3 +33,3 @@ "webpack": "^4.43.0",

},
"gitHead": "edca8a8ba7014118db5d4687e6069dbbc7be3e56"
"gitHead": "8feadcb47dbb7c06de278e9abfd9c28ae8e2b905"
}
<!-- omit in toc -->
# @simplewebauthn/browser

@@ -11,3 +10,3 @@

- [UMD](#umd)
- [Usage - Coming Soon](#usage---coming-soon)
- [Usage](#usage)

@@ -38,4 +37,6 @@ ## Installation

## Usage - Coming Soon
## Usage
Check out [the example](../../example/public/) for now until this section gets updated.
Check out [the example's public/ folder](../../example/public/) for a practical implementation of this library.
Lower-level API documentation for the methods in this library is available [here](https://simplewebauthn.netlify.app/modules/_simplewebauthn_browser.html).

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc