Class: UWA.Services.Auth

UWA/Services/Auth. UWA.Services.Auth

new UWA.Services.Auth(options)

UWA.Services.Auth constructor.

Parameters
Name Type Description
options Object

Options hash or a option/value pair.

Properties
Name Type Argument Description
adapter Object

Adapter instance

adapterOptions Object <optional>

Adapter options

Mixes In

  • UWA.Class.Options

Index

Methods

initAdapter()

Init Adapter instance.

Returns

Nothing, but set this.Adapter value.

hasIdentity(onSuccess, onFailure)

Check if user has an Identity.

Parameters
Name Type Description
onSuccess Function

on success callback

onFailure Function

on failure callback

getIdentity(onSuccess, onFailure)

Get user Identity.

Parameters
Name Type Description
onSuccess Function

on success callback

onFailure Function

on failure callback

clearIdentity(onSuccess)

Clears the current identity.

Parameters
Name Type Description
onSuccess Function

on success callback

authenticate(credentials, onSuccess, onFailure)

Authenticate user.

Parameters
Name Type Description
credentials Object

Auth adapter credentials

onSuccess Function

on success callback

onFailure Function

on failure callback

toQueryString() → {String}

Encode an Adapter to a url string that could be use by UWA.Data.request for example.

Example
var MyAuth = UWA.Services.Auth({
   adapter: 'OAuth',
   adapterOptions: {
       ...
   }
});

UWA.Data.request(providerOptions.url, {
   proxy: 'ajax',
   authentication: MyAuth
});
Returns

Adapter encoded string.

Type
String