OpenVeo Publish server

API Docs for: 8.0.0
Show:

GoogleOAuthHelper

Summary

Defines an helper for google OAuth association and requests.

Constructor

GoogleOAuthHelper

Syntax

GoogleOAuthHelper

()

Summary

Methods

fetchToken

Syntax

fetchToken

(
  • callback
)

Summary

Retrieves the current token or null if it was not persisted earlier.

Parameters:

  • callback Function

    Callback function with :

    • Error The error if an error occurred, null otherwise
    • Object The token object

getAuthUrl

Syntax

getAuthUrl

(
  • options
)
String

Summary

Builds the url that will permit to access google association page on the client's browser.

Parameters:

  • options Object

    Options to build the url, 'scope' is mandatory

Returns:

String:

The url to the google association page

getFreshToken

Syntax

getFreshToken

(
  • callback
)

Summary

Retrieves a fresh (=valid) token, if a previous token was set and is still valid it is returned. If this previous token is not valid anymore a new token is retrieved. This function should be used after a previous successfull google association.

Parameters:

  • callback Function

    Callback function with :

    • Error The error if an error occurred, null otherwise
    • Object The token object

hasToken

Syntax

hasToken

(
  • callback
)

Summary

Checks whether or not a previous token has been retrieved.

Parameters:

  • callback Function

    Callback function with :

    • Error The error if an error occurred, null otherwise
    • Boolean true a token exists, false otherwise

persistTokenWithCode

Syntax

persistTokenWithCode

(
  • code
  • callback
)

Summary

Retrieves a token from google with an authorization code, this token is then saved for later use and can be retrieved with @see this.fetchToken.

Parameters:

  • code String

    The authorization code

  • callback Function

    Callback function with :

    • Error The error if an error occurred, null otherwise
    • Object The token object

saveToken

Syntax

saveToken

(
  • tokens
  • [callback]
)

Summary

Persists the tokens retrieved from Google.

Parameters:

  • tokens Object

    The tokens retrieved from Google

  • [callback] Function optional

    Callback function with:

    • Error The error if an error occurred, null otherwise
    • Object The saved token object

Properties

oauth2Client

Syntax

oauth2Client

OAuth2 final

Summary

Google oauth client library.