This page describes the authentication workflow used by the Myshop Travel Draw demo.
In general, the following authentication mechanism is used:
general authentication workflow
A user (the client) requests authentication information from a service provider (the server) to authenticate with. The service provider creates and signs the requested data and makes it available to the user. The user then verifies the authenticity of this data by checking the signature and the service provider-related identity data stored on the Blockchain.
If the user accepts the authentication request information, the user creates and signs an authentication request that contains the request data as payload and sends it back to the service provider. The service provider in turn verifies the authenticity of the received information by checking the signature and the entity related Blockchain data.
The difference here is the way in which the user provides identity-related data. In contrast to the service provider, who has stored his identity data publicly accessible on the Blockchain, the user only reveals the necessary (requested) data by creating a verifiable claim.
The following data schema for exchanging authentication related data is used.
Since multiple peer verification mechanisms are thinkable, two types of authentication requests are specified to meet the requirements of the travel draw demo.
interface StaticRequest {
type: string; // authentication type
title: string; // title shown to user
authItemNames?: string[]; // authentication item names (see itemNames)
reqItemNames?: string[]; // request item names (see itemNames)
urls?: {label: string, url: string}[]; // additional urls shown to the user
api: string; // endpoint where to request authentication
}
The StaticRequest type is the response to an authentication request information request. It should tell the user which data a service provider expects and how the user can transfer this data to the provider. It also provides the user with additional information about the service to which he or she wants to authenticate.
interface StaticResponse {
type: string; // authentication type
authItems?: ClaimObject; // user claim
reqItems?: {name: string, vale: string}[]; // request items
}
The StaticResponse type describes the payload of the user authentication request. It provides the service provider with verifiable data created with the claim module and additional, non-verifiable, requested data.
To standardize requestable information, so-called data items are used, which consist of a name and a value property.
type Item {
name: ItemNames; // requestable information type
value: string; // information value
}
The name property shows the type of information being requested and must be one of the following elements:
enum ItemNames {
ADDRESS_CITY = "address:city",
ADDRESS_COUNTRY = "address:country",
ADDRESS_NUMBER = "address:number",
ADDRESS_STREET = "address:street",
ADDRESS_ZIP = "address:zip",
COMPANY_LEGAL_FORM = "company:legalForm",
COMPANY_MANAGING_DIRECTOR = "company:manDir",
COMPANY_NAME = "company:name",
COMMERCIAL_REGISTER_NAME = "comReg:name",
COMMERCIAL_REGISTER_NUMBER = "comReg:number",
CONTACT_EMAIL = "contact:email",
ENTITY_NAME = "entity:name",
LEGAL_TERMS_AND_CONDITIONS = "legal:tac",
PERSON_FIRST_NAME = "person:firstName",
PERSON_SURNAME = "person:surName",
PERSON_BIRTHDAY = "person:birthDay",
TAX_VATID = "tax:vatId"
}
There are three different ways in which data elements are stored on the Blockchain.
Data items can be stored directly in the payload field of the authentication protocol. In this case, the data items are stored within a JSON object in the following way:
payload = {
data: [
{
name: <data name>,
value: <data value>
},
...
]
}
You can find an example here.
In case data items within a verifiable claim need to be verified, the root hash of the claim can be found in the payload field of the attestation protocol:
payload = {
rootHash: <claim root hash>
}
You can find an example here.
To bypass the 120 character limitation of an attestation protocol payload field, a transaction hash is stored in this field that points to a data cloud transaction.
payload = {
txHash: <transaction full hash>
}
You can find an example here.
the referenced transaction then stores the data items in a JSON object:
object = {
data: [
{
name: <data name>,
value: <data value>
},
...
]
}
You can find an example here.
The travel draw demo uses the following participants to create two authentication paths for entity verification:
travel draw attestation paths
It uses different attestation contexts for each attestation a paths.
The root account acts as the trust anchor for both attestation paths.
It has the following data items stored on Blockchain:
The server CA guarantees the authenticity of the service provider.
It has the following data items stored on Blockchain:
The server entity represents the MyShop Server and has the following data items stored on Blockchain:
CAUTION: It's just a fictive company.
The client CA guarantees the authenticity of the user.
It has the following data items stored on Blockchain:
CAUTION: It's just a fictive company.
The client entity represents the user. It has no data items stored on Blockchain. It has previously received a claim from its authority with the following data items:
CAUTION: It's just a fictive person.
The authentication mechanism used by the travel draw demo differs slightly from the general authentication workflow. Since the draw announcement is static and therefore the signature time of the announcement is not validated on user side (represented as Blobaa App), the announcement data has been created beforehand and made available to the MyShop frontend. As an advantage, the travel draw information (the static request described above) can now be provided statically within a QR Code printed on a poster.
The user scans the code, verifies the request and checks the identity of MyShops. After a successful verification the static response will be created and sent to the MyShop backend.
The backend then verifies the authenticity of the user data and response with a submission status.
travel draw authentication workflow
The following request data is used for authentication.
StaticRequest = {
type: "request:static",
desc: "MyShop Travel Draw",
authItemNames: [
"address:city",
"address:country",
"address:number",
"address:street",
"address:zip",
"person:firstName",
"person:surName",
"person:birthDay"
],
urls: [
{ label: "Draw", url: "https://www.blobaa.dev/demo/myshop/draw" },
{ label: "Terms and Conditions", url: "https://www.blobaa.dev/demo/myshop/draw/tac" }
],
reqItemNames: [
"legal:tac",
"contact:email"
],
api: "https://api.blobaa.dev/v1/myshop/draw/authResponse"
}
StaticResponse = {
type: "request:static",
authItems: ClaimObject // user claim
reqItems: [
{ name: "legal:tac", vale: "true"},
{ name: "contact:email", vale: "max.mustermann@gmail.com"},
]
}