Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make mock site hotel-bogota use Authenticator #413

Open
SmartLayer opened this issue Jan 8, 2021 · 0 comments
Open

make mock site hotel-bogota use Authenticator #413

SmartLayer opened this issue Jan 8, 2021 · 0 comments
Assignees

Comments

@SmartLayer
Copy link

SmartLayer commented Jan 8, 2021

This branch:
https://github.com/TokenScript/TokenScript/tree/hotel-bogota/examples/sites/hotel-bogota

Pseudo code:

// this will open the iframe to attestation.id if first time
const useTicketProof  = Authenticator.generateAuthenticationBlob(selectedTicket);

// getting a challenge

const challenge = fetch(…)…

// sign a challenge contain

const msg = '{challenge: "' + challenge + '", proof: "' + atob(useTicketProof) + '"}'
const signedMsg = web3.eth.account.signMessage(msg)

// send the challenge back to the server

fetch(URL, {method: post, body: signedMsg;}).…

// get server greenlight, fetch privileged content
…

Operational Attributes

There are a few operational attributes, most importantly ownerAddress, however, it is not discovered until webster's code runs generateAthenticationBlob, which is confusing (as webster might not expect this function to change the token object. Therefore alternatively the function can be changed:

Authenticator.assertOwnerAddress(token) // this changes the token object

Which results in two operational attributes:

{
  devconID: 6,
  ticketID: 8080,
  ticketClass: 0,
  ownerAddress: 0xd55729e2A0C82b193cdb0d026f576f3ab5Aeac3e;
  ownershipProof: ArrayBuffer(…);
}

i.e. instead of returning the blob in a function call like originally planned, store it in the token object as Operational Attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants