Enumerate Authentication Tokens

Title

List authentication tokens manually generated for 3rd party applications

URL Path

vault_rest/tokens/{start}/{count}

Method

GET

CORS support

Yes

Http return

200, 400, 401, 403, 500

Table of Contents

Last Updated

08 May 2017

Summary

Returns authentication tokens generated by a user to allow 3rd party applications to connect to MetaDefender Vault .

Use Cases

Used by the web user interface to display generated authentication tokens.

HTTP header parameters

Name

Value

Required

Description

Example

Authorization

The authentication token of the caller

REQUIRED

This header should have the following format:
Bearer [token obtained from authenticate API]
Example: Bearer Cp01BwnXAIOLZXxn7yogjKqIZnZpQD

GET /vault_rest/tokens/0/100 HTTP/1.1
Host: localhost:8000
Authorization: Bearer f3I8Vss3cWAuh3EscB06QRDcQfMzHY
sort_column: Created
sort_direction: desc
find: jza4XRo
findB64: anphNFhSbw==

sort_column

Name of column to use when sorting data

OPTIONAL

Possible values: Token, Created, Expires, Description, Role

sort_direction

Sorting direction

OPTIONAL

Possible values, asc, desc

find

Free text search string

OPTIONAL

Searches Token & Description

findB64

Free text search string (Base64 encoded)

OPTIONAL

Free text search string (Base64 encoded to support all charsets). Will override any value specified in 'find' header.

Method: GET

start

Zero based position in list from where to start returning data

REQUIRED

count

Maximum number of list entries to return

REQUIRED

Request Error

400

Bad Request

Invalid HTTP request

401

Invalid parameter

One or more parameters are invalid

403

Forbidden

Authentication token is incorrect

500

Internal Server Error

Server is temporarily unavailable

Response

Example of a successful request:

{
"filter_count" : 2,
"items" : [{
"token_id" : 1,
"token" : "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"description" : "Metadefender access token",
"status" : "valid",
"created" : "2015-07-02T12:00:00.0000000Z",
"expires" : "2016-01-01T12:00:00.0000000Z",
"role" : "guest"
}, {
"token_id" : 2,
"token" : "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB",
"description" : "3rd party access token",
"status" : "expired",
"created" : "2015-01-02T12:00:00.0000000Z",
"expires" : "2015-06-01T12:00:00.0000000Z",
"role": "user"
}
],
"total_count" : 2
}

Descriptions of response:

filter_count

Filtered entries count

Total number of entries in the database when a filter has been applied (no filtering is currently available in this API). If no filter is specified this value is always equal to total_count.

total_count

Total entries count

Total number of entries in the database.

items

Array of entries

 

items.token_id

Token unique id

 

items.token

Token

 

items.description

Token description

 

items.status

Token status

Possible values:
valid
expired

items.created

Token creation date

Date+time (in UTC) when the token was created.

items.expires

Token expiry date

Date+time (in UTC) when the token expires.

items.role

Token role type

Possible values:

Guest
User
Administrator