Brevada / brv

Official Brevada Repository
http://brevada.com
2 stars 0 forks source link

[In-House API] Device Authentication #208

Closed noahnu closed 7 years ago

noahnu commented 7 years ago

Need a protocol for device/tablet to server communication to ensure:

Requirements

[? = Uncertain / Optional]

Under assumptions:

Proposed Implementation

Using HTTP Bearer Authorization. Not full OAuth.

Register API

Renew API

Request Token Generation


Related to #99

noahnu commented 7 years ago

Update: Just need to add the "handshake" to the client and a way to generate request tokens.

New Schema:

CREATE TABLE `device_request_tokens` (
    `StoreID` INT(11) NOT NULL,
    `RequestToken` VARCHAR(128) PRIMARY KEY,
    `ExpiryDate` INT(11) NOT NULL,
    FOREIGN KEY (`storeID`) REFERENCES stores(`id`)
        ON UPDATE CASCADE
        ON DELETE CASCADE
) ENGINE=InnoDB;

CREATE TABLE `device_authorization` (
    `AccessToken` VARCHAR(128) PRIMARY KEY,
    `DeviceUUID` VARCHAR(128) UNIQUE KEY,
    `ExpiryDate` INT(11) NOT NULL
) ENGINE=InnoDB;

ALTER TABLE `tablets` ADD UNIQUE (`SerialCode`);
noahnu commented 7 years ago

Schema changes made to production.