forked from LupusNobilis/ln.vue
WIP
parent
0de72abc3d
commit
d1663cbbbe
20
demo.html
20
demo.html
|
@ -11,6 +11,7 @@
|
||||||
<script type="text/javascript" src="js/ln.vue.js"></script>
|
<script type="text/javascript" src="js/ln.vue.js"></script>
|
||||||
<script type="text/javascript" src="js/ln.vue.components.js"></script>
|
<script type="text/javascript" src="js/ln.vue.components.js"></script>
|
||||||
<script type="text/javascript" src="js/ln.vue.table.js"></script>
|
<script type="text/javascript" src="js/ln.vue.table.js"></script>
|
||||||
|
<script type="text/javascript" src="js/ln.vue.webauthn.js"></script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
table#controls > tbody > tr > td:nth-child(3) {
|
table#controls > tbody > tr > td:nth-child(3) {
|
||||||
|
@ -177,6 +178,25 @@
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
app.addModule({
|
||||||
|
navigation: {
|
||||||
|
protocols: {
|
||||||
|
label: 'Protocols',
|
||||||
|
navigation: {
|
||||||
|
webauthn: {
|
||||||
|
label: 'webauthn',
|
||||||
|
path: '/protocols/webauthn',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
routes: {
|
||||||
|
'/protocols/webauthn': {
|
||||||
|
url: '/webauthn.html',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
app.Start();
|
app.Start();
|
||||||
|
|
||||||
LNVue.onidle(()=>{
|
LNVue.onidle(()=>{
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
(function(){
|
||||||
|
|
||||||
|
LNVue.prototype.createCredentials = function(_challenge,rp,userId,crossplatform,attestation){
|
||||||
|
crossplatform = crossplatform ? true : false;
|
||||||
|
if (!attestation)
|
||||||
|
attestation = "none";
|
||||||
|
|
||||||
|
let credCreateOptions = {
|
||||||
|
challenge: Uint8Array.from(_challenge, c => c.charCodeAt(0)),
|
||||||
|
rp: {
|
||||||
|
id: rp,
|
||||||
|
name: 'LN.Vue Demo Application',
|
||||||
|
},
|
||||||
|
user: {
|
||||||
|
id: Int8Array.from(userId, c => c.charCodeAt(0)),
|
||||||
|
name: 'SomeUser',
|
||||||
|
displayName: "Some user for now...",
|
||||||
|
},
|
||||||
|
pubKeyCredParams: [
|
||||||
|
{
|
||||||
|
type: 'public-key',
|
||||||
|
alg: -7,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
authenticatorSelection: {
|
||||||
|
authenticatorAttachment: crossplatform ? 'cross-platform' : 'platform',
|
||||||
|
},
|
||||||
|
timeout: 60000,
|
||||||
|
attestation: attestation,
|
||||||
|
};
|
||||||
|
|
||||||
|
console.log(credCreateOptions);
|
||||||
|
navigator.credentials.create({
|
||||||
|
publicKey: credCreateOptions
|
||||||
|
});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
LNVue.prototype.createAuthToken = function(){
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
})();
|
|
@ -0,0 +1,9 @@
|
||||||
|
<div>
|
||||||
|
<h1>webauthn - demo</h1>
|
||||||
|
<div>Use the buttons to start demo action...</div>
|
||||||
|
|
||||||
|
<button
|
||||||
|
@click="LNVue.createCredentials('ABCDEFGHIJKLMNOPQRSTUVWXYZ','LNVue Demo Application','1234567890',true);"
|
||||||
|
>Register</button>
|
||||||
|
|
||||||
|
</div>
|
Loading…
Reference in New Issue