Authorization
Authorization is done using the OAuth2 standard.
Definitions
- RoviTracker (server)
- RoviTracker web application that hosts all of the equipment info and metric data.
- Application
- Rental or management software (other than RoviTracker) accessing protected resources hosted by RoviTracker, on behalf or a resource owner (shared customer).
- Customer
- The user (shared customer) who authorizes an application to access their account.
Intended Use
A Customer wants to see their equipment data collected by RoviTracker displayed on the Application
(rental management software, etc).
The Customer authorizes the Application to access their RoviTracker data.
The Application requests data regularly from RoviTracker using the authorization provided by the Customer.
Registration Process
The registration process only happens once at the beginning:
- Register
Applicationwith RoviTracker by providing a company name and logo. - Receive a
client_idand aclient_secret.
Authorization (preferred: automatic, customer directed)
ApplicationdirectsCustomerto https://rovitracker.com/app/oauth2/authorize?client_id=CLIENT_ID&state=STATE&redirect_uri=REDIRECT_URI With variables replaced with:CLIENT_ID-client_idvalue obtained through the registration processSTATE- A value (nonce) used to maintain state betweenRoviTrackerserver andApplication: https://tools.ietf.org/html/rfc6749#section-4.1.1REDIRECT_URI- A URL controlled byApplicationwhereRoviTrackerwill send theCustomerafter authorization. This URL will prompt theCustomerto authorizeApplicationto access their data stored atRoviTracker.
Customerconfirms authorization promptCustomeris redirected to REDIRECT_URI?code=AUTHORIZATION_CODE&state=STATE Where:REDIRECT_URIis the URL provided by theApplicationin step 1.STATEwill be the same value provided by theApplicationin step 1.
Applicationtakes theAUTHORIZATION_CODEfrom the query string parameter and exchanges it for anaccess_tokenby making an HTTP POST request withContentType: application/x-www-form-urlencodedto:https://app.rovitracker.com/app/oauth2/tokenwith body parameters of:client_id: Value obtained through registration process.client_secret: Value obtrained through registration process.code: Authorization code obtained through redirect (step 3). The body should be encoded like a traditional form POST, with each parameter urlencoded, like:client_id=XXXXXXXXXX&client_secret=XXXXXXXXXXX&code=XXXXXXXXXX. The server will respond with JSON response with an access token like:{"access_token": "234acb234badeeefee2342", "type": "Bearer"}
Applicationstores and protects the access token for later use when requesting data.
Authorization (alternate: manual, RoviTracker-directed)
Applicationsends an email toRoviTrackerrequesting access to a particular client.RoviTrackerconfirms withCustomerthat the request is valid.RoviTrackersends an email withaccess_tokentoApplication.
Requesting Data
You can now request data using the AEMP API