Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Introduction

The API requires a token sent on each request via the Authorization header to authenticate. This token can be obtained by making a POST request to the URI /auth/request-token where you'll include your VSKEY credentials using the Authorization Header.

The EIS Virtual Cloud RESTful API is currently in BETA. If you are a current customer and would like to join through this period, please refer to the following KB Article.

Authentication tokens are valid for 24 hours (86,400 sec). After this period, a new token must be requested.

Examples

This section shows how to request an authentication token using HTTPie and RESTful API - Authentication.

HTTPie

http POST https://vss-ws.eis.utoronto.ca:8001/auth/request-token -a <username>
http: password for <username>@vss-ws.eis.utoronto.ca:8001: 
Response Headers
 HTTP/1.1 200 OK
Allow: POST, OPTIONS
Connection: keep-alive
Content-Length: 179
Content-Type: application/json
Date: Fri, 29 Apr 2016 11:52:47 GMT
Server: nginx
Strict-Transport-Security: max-age=63072000
X-Content-Type-Options: nosniff
X-Frame-Options: DENY
X-RateLimit-Limit: 5
X-RateLimit-Remaining: 4
X-RateLimit-Reset: 1461930780
Response Body
{
    "duration": 86400, 
    "token": "<token_here>", 
    "user": "<username>"
} 

CURL

curl -X POST https://vss-ws.eis.utoronto.ca:8001/auth/request-token -u <username>Enter host password for user '<username>':
Response Headers
HTTP/1.1 200 OK
Server: nginx
Date: Fri, 29 Apr 2016 12:00:20 GMT
Content-Type: application/json
Content-Length: 179
Connection: keep-alive
X-RateLimit-Remaining: 4
X-RateLimit-Limit: 5
X-RateLimit-Reset: 1461931230
Allow: POST, OPTIONS
Strict-Transport-Security: max-age=63072000
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Response Body
{
  "duration": 86400, 
  "token": "<token_here>", 
  "user": "<username>"
}⏎

Unauthorized

Getting a 401 Unauthorized error as shown below, could be due to the following reasons:

Response
HTTP/1.1 401 UNAUTHORIZED
Allow: POST, OPTIONS
Connection: keep-alive
Content-Length: 103
Content-Type: application/json
Date: Fri, 29 Apr 2016 12:04:42 GMT
Location: https://vss-ws.eis.utoronto.ca:8001/auth/request-token
Server: nginx
WWW-Authenticate: Basic realm="Authentication Required"

{
    "error": "unauthorized", 
    "message": "Please authenticate to get your token.", 
    "status": 401
}

Username and password combination is not valid

Re-initializing your VSKEY credentials is strongly advised. To do so, please follow this KB Article.

User is not permitted to access the API.

Contacting the VSS Team to request access is advised by email or our contact form.

 

  • No labels