OpenVeo Core server

API Docs for: 7.0.0
Show:

accessToken

Module: core-oauth

static

Summary

Provides functions to interface oauth tokens and openveo Web Service.

Item Index

Methods

Properties

Methods

checkTTL

Syntax

checkTTL

(
  • token
)
Boolean static

Summary

Checks if token is valid and not expired.

Parameters:

  • token Object

    The access token

Returns:

Boolean:

true if the token is valid, false otherwise

create

Syntax

create

(
  • userId
  • clientId
  • scopes
  • ttl
  • callback
)
static async

Summary

Creates access token and saves it in database.

It will previously remove all tokens associated to the client.

Parameters:

  • userId String

    User identifier associated to the OAuth client

  • clientId String

    OAuth client id

  • scopes Object

    The list of scopes

  • ttl Number

    Token time to live (in seconds)

  • callback Function

    with:

    • Object An error if something went wrong or null if everything is fine
    • String The access token

fetchByToken

Syntax

fetchByToken

(
  • token
  • callback
)
static async

Summary

Fetches accessToken object by token.

Parameters:

  • token String

    Client's access token

  • callback Function

    with :

    • Object An error if something went wrong or null if everything is fine
    • Object The access token

getTokenProvider

Syntax

getTokenProvider

() TokenProvider private

Summary

Gets token provider.

Returns:

TokenProvider:

The token provider

Properties

ttl

Syntax

ttl

Number

Summary

Default token Time To Live value (1 hour).

Default: 3600