Final Class: OAuth

Oracle® JavaScript Extension Toolkit (JET)
8.1.0

F24337-01

QuickNav


OAuth

Version:
  • 8.1.0
Since:
  • 1.0.0
Module:
  • ojmodel

Module usage

See JET Module Loading for an overview of module usage within JET.

Javascript Import Format
define(['ojs/ojmodel'], function(model) {
 // Application should call API on model.OAuth 
})
Typescript Import Format
//To import this class, use the format below.
import {OAuth} from "ojs/ojmodel";

JET In Typescript

A detailed description of working with JET elements and classes in your typescript project can be found at: JET Typescript Usage.

Final classes in JET

Classes in JET are generally final and do not support subclassing. At the moment, final is not enforced. However, this will likely change in an upcoming JET release.

Description

Member of Model objects. Object representing name/value pairs for a data service record

Constructor

new OAuth(attributes, header)

Parameters:
Name Type Description
attributes Object Initial set of attribute/value pairs with which to seed this OAuth object
header string Actual name for the Authorization header (default 'Authorization')

Methods

cleanAccessTokenRequest() : {undefined}

Clean request part of the OAuth object (client credentials, uri endpoint) Null and remove all data from request part of the OAuth object
Returns:
Type
undefined

cleanAccessTokenResponse() : {undefined}

Clean response part of the OAuth object (access_token, e.t.c.) Null and remove all data from response part of the OAuth object
Returns:
Type
undefined

clientCredentialGrant() : {undefined}

Request for access_token(bearer token) using Client Credential Authorization Grant. Initialize response part of the OAuth object (access_token, e.t.c.)
Returns:
Type
undefined

getAccessTokenRequest() : {Object}

Get request part of the OAuth object (client credentials, uri endpoint)
Returns:
cached request
Type
Object

getAccessTokenResponse() : {Object}

Get response part of the OAuth object (access_token, e.t.c.)
Returns:
cached response
Type
Object

getHeader() : {Object}

Calculates Authorization header based on client credentials or access_token
Returns:
OAuth 2.0 Authorization header
Type
Object

isInitialized() : {boolean}

Check is OAuth initialized (not null access_token).
Returns:
true/false
Type
boolean

setAccessTokenRequest(data) : {undefined}

Set request part of the OAuth object (client credentials, uri endpoint)
Parameters:
Name Type Description
data Object current client credentials and uri
Returns:
Type
undefined

setAccessTokenResponse(data) : {undefined}

Set response part of the OAuth object (access_token, e.t.c.)
Parameters:
Name Type Description
data Object current response
Returns:
Type
undefined