update auth openpgp.js
This commit is contained in:
@@ -1,57 +1,130 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-6" data-spacename="explain">
|
||||
<div class="col-sm-6" data-spacename="explain">
|
||||
<h2>How it works</h2>
|
||||
<p> Alias is a unique string that humainly help to match a PublicKey to check existing alias</p>
|
||||
<code>
|
||||
GET /api/odmdb/idx/pagans/pagans_alias_all.json with a correct headers
|
||||
RESULT
|
||||
data:{alias:publicKey}
|
||||
</code>
|
||||
<p>
|
||||
Run
|
||||
</p>
|
||||
<p class="small">
|
||||
Mandatory: apixtrib header have to set with:<br>
|
||||
* {xalias,xhash,xdays,xtribe,xlang,xapp}<br>
|
||||
* xhash is a detached signature done with public and private key of message: 'alias_xdays' where xdays is a time
|
||||
stamp
|
||||
a xhash has an elapse of 24hours after it has to be recreate.<br>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-6" data-spacename="userinterface">
|
||||
We need in local storage auth for this example {alias,passphrase,privatekey, publickey} to be able to create a
|
||||
detached signature<br>
|
||||
On the server side we check that signature xhash of alias_timestamp is valid with the public key
|
||||
</p>
|
||||
<p> Alias is a unique string that humainly help to find a PublicKey that is the real identity.
|
||||
To get the list of existing alias</p>
|
||||
<button type="button" class="btn btn-outline-success btn-sm"
|
||||
onclick="app.runapirequest('modalinfo',{method:'GET',url:'nationchains/pagans/idx/alias_all.json'},{title:'Alias list',body:'',actions:[], classmodaldialog:'modal-xl'})">show
|
||||
it</button>
|
||||
</p>
|
||||
<code>
|
||||
GET nationchains/pagans/idx/alias_all.json -> data:{alias:{alias:publicKey}}
|
||||
</code>
|
||||
<p>To allow trustable Tribe to store the Private and Passphrase Key, you get from the townId_all.json key:tribes</p>
|
||||
<button type="button" class="btn btn-outline-success btn-sm"
|
||||
onclick="app.runapirequest('modalinfo',{method:'GET',url:'nationchains/towns/idx/townId_all.json'},{title:'Tribes list',body:'',actions:[], classmodaldialog:'modal-xl'})">show
|
||||
it</button>
|
||||
<code>
|
||||
GET /nationchains/towns/idx/townId_all.json -> data:{townId:{tribes:[list of tribeId inside a town]}}
|
||||
</code>
|
||||
|
||||
</div>
|
||||
<div class="col-sm-6" data-spacename="userinterface">
|
||||
<div class="row g-3">
|
||||
<h3>A decentralized Identity</h3>
|
||||
<p>apXtrib allow you to create keys to identify yourself with a universal alias</p>
|
||||
<div class="col-md-6">
|
||||
<label for="inputalias" class="form-label">Your alias</label>
|
||||
<input type="text" class="form-control" id="inputalias" placeholder="A public alias that any one see">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="inputemailrecovery" class="form-label">Email Recovery</label>
|
||||
<input type="email" class="form-control" id="inputemailrecovery" placeholder="optional, if you want to receive by mail your keys">
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label for="inputpassphrase" class="form-label">A passphrase</label>
|
||||
<input type="text" class="form-control" id="inputpassphrase" placeholder="optional, a passphrase to remember, each time something try to use your privateKey this passphrase will be requested">
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<button type="button" id="generatekeys" onclick="app.createIdentity(document.getElementById('inputalias').value,document.getElementById('inputpassphrase').value)" class="btn btn-primary">Generate keys</button>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="gridCheck">
|
||||
<label class="form-check-label small" for="gridCheck">
|
||||
<b>I trust smatchit to keep my private key and email </b><br>
|
||||
<b>If i don't trust</b> please download your keys (be aware, none than you can have access to your cipher data).<br>
|
||||
If you set a correct email then you will receive your keys on your mailbox (Carefull by sending email, smatchit and anyone that access to your email can see your keys).<br>
|
||||
The safer to be sure no one else than your local browser can see it, just download localy and save it on a personnal cold support (usb key).<br>
|
||||
If you use a browser that <b>can be accessible by someone else, don't forget to "logout"</b> to clean up any trace.<br>
|
||||
If you have any suspicious please
|
||||
</label>
|
||||
<h3>Am i authenticated to api?</h3>
|
||||
<button type="button" id="btntestauth" class="btn btn-outline-success btn-sm"
|
||||
onclick="app.runapirequest('modalinfo',{method:'GET',url:'api/pagans/isauth'},{title:'Am i authenticated',body:'',actions:[], classmodaldialog:'modal-xl'})">
|
||||
Test it</button>
|
||||
<code>
|
||||
GET 'api/pagans/isauth' -> status 200 : Well authenticated with alias, status 400: not authenticated
|
||||
</code>
|
||||
<hr>
|
||||
<h3>Logout</h3>
|
||||
<button type="button" class="btn btn-outline-success btn-sm"
|
||||
onclick="delete apx.data.auth;apx.data.headers=apxlocal.headers;apx.save();alert('delete apx.data.auth and reinit apx.data.header')">
|
||||
Remove headers</button>
|
||||
<hr>
|
||||
<h3>I proove that i own this alias</h3>
|
||||
<div class="col-md-6">
|
||||
<label for="inputaliasauth" class="form-label">Your alias</label>
|
||||
<input type="text" class="form-control" id="inputaliasauth" placeholder="A public alias that any one see">
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label for="inputpassphraseauth" class="form-label">A passphrase</label>
|
||||
<input type="text" class="form-control" id="inputpassphraseauth"
|
||||
placeholder="optional, a passphrase to remember, each time something try to use your privateKey this passphrase will be requested">
|
||||
</div>
|
||||
<textarea rows="5" id="privatekeyauth"></textarea>
|
||||
<button class="btn btn-primary"
|
||||
onclick="pagans.authentifyme(document.getElementById('inputaliasauth').value,document.getElementById('inputpassphraseauth').value,document.getElementById('privatekeyauth').value);document.getElementById('btntestauth').click()">I
|
||||
am alias</button>
|
||||
<hr>
|
||||
<h3>Create a decentralized Identity</h3>
|
||||
<p>apXtrib allow you to create keys to identify yourself with a universal alias</p>
|
||||
<div class="col-md-6">
|
||||
<label for="inputalias" class="form-label">Your alias</label>
|
||||
<input type="text" class="form-control" id="inputalias" placeholder="A public alias that any one see">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="inputemailrecovery" class="form-label">Email Recovery</label>
|
||||
<input type="email" class="form-control" id="inputemailrecovery"
|
||||
placeholder="optional, if you want to receive by mail your keys">
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<label for="inputpassphrase" class="form-label">A passphrase</label>
|
||||
<input type="text" class="form-control" id="inputpassphrase"
|
||||
placeholder="optional, a passphrase to remember, each time something try to use your privateKey this passphrase will be requested">
|
||||
</div>
|
||||
<button type="button" id="generatekeys"
|
||||
onclick="pagans.createIdentity(document.getElementById('inputalias').value,document.getElementById('inputpassphrase').value)"
|
||||
class="btn btn-primary">Generate keys</button>
|
||||
<div id="trustintribe" class="d-none">
|
||||
<div class="mb-3 row">
|
||||
<div class="col-12">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" id="trustedcheck"
|
||||
onclick="document.getElementById('selecttrusttribe').classList.toggle('d-none');">
|
||||
<label class="form-check-label small" for="trustedcheck">
|
||||
<b>I trust a tribe to keep my private key and email, doing this i automaticaly create a Person space in
|
||||
tribe i trust. </b>
|
||||
I understand that someone with tribe accessrights(druid) from this tribe can read my personnal data by
|
||||
unciphering my
|
||||
data.<br>
|
||||
<b>If i don't trust</b> i understand that if i loose my privatekey i also loose my data.<br>
|
||||
If you set a correct email then you will receive your keys on your mailbox, this email is not store if
|
||||
you do not trust<br>
|
||||
If you use a browser that <b>can be accessible by someone else, don't forget to "logout"</b> to clean up
|
||||
any trace.<br>
|
||||
<b>In any case please download your keys and move it on a usb key or/and print it</b><br>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="selecttrusttribe" class="d-none">
|
||||
<label for="selectnationid" class="col-12 col-form-label">If you want to trust in a Tribe to store your
|
||||
private key, please chose a tribe which you trust in</label>
|
||||
<div class="col-12">
|
||||
<select class="form-select" id="trustedtribe" aria-label="" placeholder="A tribe to store my private key">
|
||||
{{#tribes}}
|
||||
<option {{#selected}}selected{{/selected}} value="{{tribeId}}">{{tribeId}}</option>
|
||||
{{/tribes}}
|
||||
</select>
|
||||
<input class="d-none" id="inputtribeId" value="{{tribeId}}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="downloadkeys" class="btn-group d-none">
|
||||
<p>Download your keys at least PrivateKey this have to save in a secret place</p>
|
||||
<button id="privatekey" key="" class="btn btn-outline-primary" onclick="app.downloadlink('pagans.privateKey',apx.data,apx.data.headers.xapp);" >Download PrivateKey</button>
|
||||
<button id="publickey" key="" class="btn btn-outline-primary" onclick="app.downloadlink('publicKey',this.getAttribute('key'),apx.data.headers.xapp);">Download PublicKey</button>
|
||||
</div>
|
||||
<div id="createId" class="col-12 d-none">
|
||||
<button class="btn btn-primary" onclick="app.registerIdentity()">Create this identity</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="downloadkeys" class="btn-group d-none">
|
||||
<p>Download your keys at least PrivateKey this have to save in a secret place</p>
|
||||
<button id="privatekey" key="" class="btn btn-outline-primary"
|
||||
onclick="app.downloadlink('auth.privateKey',apx.data,apx.data.headers.xapp);">Download PrivateKey</button>
|
||||
<button id="publickey" key="" class="btn btn-outline-primary"
|
||||
onclick="app.downloadlink('auth.publicKey',this.getAttribute('key'),apx.data.headers.xapp);">Download
|
||||
PublicKey</button>
|
||||
</div>
|
||||
<div id="createId" class="col-12 d-none">
|
||||
<button class="btn btn-primary" onclick="pagans.registerIdentity();">Create
|
||||
this identity</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
Reference in New Issue
Block a user