Result of last TokenScript meeting.
U = Ticket Recipient
DT = Devcon Ticket Site
AID = identifier attestation issuer (attestation.id)
TPS = Third-party website (bogota.hotel)
BLS = Browser Local Storage
EP/CA = explicit permission or capability attestation
Flow to create attestation (need negotiator+authenticator on DT)
- Devcon website (after user paid for the ticket) generate a ticket attestation -> magiclink
- U receives magicLink with email, clicks it
- DT opened, ticket saved in the BLS
- DT opens AID in iframe and ask for matching identifier attestation;
- AID asks for EP/CA
- AID returns result by checking AID's BLS.
- if none found, the AID asks for identifier (if not provided already - in devcon case provided in magic link);
- sends (by email or SMS) an OTP to the identifier ( for example "Please check your email to get the OTP" )
- U types the OTP and signs it with Metamask and send signature to AID.
- AID creates identifier attestation+secret, save it in AID's BLS, send "SUCCESS" to DT.
For DEVCON_6, step 3, 5, 6 are simplified;
3 -> simplified with hardcoded domain name 5,6 -> implement proper logic later when devcon ends. The entire magic link is sent to AID instead;
TPS = Third-party website (Hotel Bogota) TPS need to install negotiator npm module
- with the negotiator, TPS opens iframe to DT and requests DT for tickets list with EP/CA
- DT iframe answers with list
- negotiator returns promise with the list of tokens the user allowed to use on TPS
- later, TPS requires the token to be authenticated (i.e. user is in booking confirmation). when that happens:
- DT request AttestaionId for attestation+secret
- DT creates useTicket object and signs it
- DT sends signedUseTicket to TPS
- TPS sends signedUseTicket to the TPSBackendServer
- TPSBackendServer sends signedUseTicket to some AUTH_SERVER API for validation
- if AUTH_SERVER API answer valid then TPSBackendServer creates user session or add current user prmission to have Ticket benefits and send updated products list to the TPS
Total, what we need to install
- TPS - negotiator
- DT - [unspecified - up to the implementor @nicktaras
- TPSBackendServer need to know how to work with AUTH_SERVER API
- AUTH_SERVER API (nodejs or Java for now)
- update Attestation.Id to work with magic link through postMessages only without UI