Class: OAuth2

message.OAuth2(oauth_verifier, code, provider, oauth_token, error_description, state)

new OAuth2(oauth_verifier, code, provider, oauth_token, error_description, state)

Method to register or login using an OAuth provider.
This resource is should be invoked by the provider with a redirect after the user granted permission.

Parameters:
Name Type Description
oauth_verifier string

OAuth 1.0 code

code string

The code written by the provider

provider string

The OAuth provider

oauth_token string

OAuth 1.0 identifier

error_description string

The error description of the oauth provider

state string

Additional form encoded state. Can contain an optional redirect (url) that will be called after login with the user token attached as query parameter.

Source:

Extends

Members

progressCallback :connector.Message~progressCallback

Type:
Inherited From:
Source:

spec :Object

The message specification

Type:
  • Object
Inherited From:
Source:

tokenStorage :util.TokenStorage

Type:
Inherited From:
Source:

withCredentials :boolean

Type:
  • boolean
Inherited From:
Source:

Methods

accept() → {string}

Gets the request accept header

Overrides:
Source:
Returns:

This message object

Type
string

acl() → {string}

Gets the ACL of a file into the Baqend-Acl header

Overrides:
Source:
Returns:

This message object

Type
string

addQueryString(query) → {this}

Adds the given string to the request path

If the parameter is an object, it will be serialized as a query string.

Parameters:
Name Type Description
query string | Object.<string, string>

which will added to the request path

Inherited From:
Source:
Returns:
Type
this

cacheControl() → {string}

Gets the cache control header

Overrides:
Source:
Returns:
Type
string

contentLength() → {number}

Gets the contentLength

Overrides:
Source:
Returns:
Type
number

customHeaders() → {string}

Gets and encodes the custom headers of a file into the Baqend-Custom-Headers header

Overrides:
Source:
Returns:

This message object

Type
string

doReceive(response) → {void}

Handle the receive

Parameters:
Name Type Description
response Object

The received response headers and data

Inherited From:
Source:
Returns:
Type
void

entity(data, typeopt) → {this}

Sets the entity type

Parameters:
Name Type Attributes Default Description
data *

The data to send

type EntityType <optional>
"json"

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

Inherited From:
Source:
Returns:

This message object

Type
this

Gets the value of a the specified request header

Parameters:
Name Type Description
name string

The header name

Overrides:
Source:
Returns:

The header value

Type
string

ifMatch() → {string}

Gets the request conditional If-Match header

Overrides:
Source:
Returns:

This message object

Type
string

ifNoneMatch() → {string}

Gets the request a ETag based conditional header

Overrides:
Source:
Returns:
Type
string

ifUnmodifiedSince() → {string}

Gets the request date based conditional header

Overrides:
Source:
Returns:

This message object

Type
string

mimeType() → {string}

Get the mimeType

Overrides:
Source:
Returns:

This message object

Type
string

noCache() → {this}

Indicates that the request should not be served by a local cache

Inherited From:
Source:
Returns:
Type
this

progress() → {connector.Message~progressCallback}

Gets the progress callback

Overrides:
Source:
Returns:

The callback set

Type
connector.Message~progressCallback

responseType() → {string}

Gets the response type which should be returned

Overrides:
Source:
Returns:

This message object

Type
string