Methods
(static) addEventListener(type, listener)
Registers the specified listener on the event target.
Available types are: 'tokenchange'.
Parameters:
Name | Type | Description |
---|---|---|
type |
String | A string representing the event type to listen for. |
listener |
function | The function to add to the event target. |
(static) authenticate(successCallback, errorCallback)
Acquires an OAuth2 access token from the server.
This may show a webview if authorization is required.
Parameters:
Name | Type | Description |
---|---|---|
successCallback |
function | |
errorCallback |
function |
(static) authenticate(successCallback, errorCallback)
Acquires a SAML session with the server. This will show a webview.
Parameters:
Name | Type | Description |
---|---|---|
successCallback |
function | |
errorCallback |
function |
(static) disable(successCallback, errorCallback)
Disables the OAuth2 challenge support
Parameters:
Name | Type | Description |
---|---|---|
successCallback |
function | |
errorCallback |
function |
(static) disable(successCallback, errorCallback)
Disable SAML2 challenge support
Parameters:
Name | Type | Description |
---|---|---|
successCallback |
function | |
errorCallback |
function |
(static) enable(config, successCallback, errorCallback, tokenopt)
Enables OAuth2 challenge support
Parameters:
Name | Type | Attributes | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
Object | The OAuth2 config
Properties
|
||||||||||||||||||||||
successCallback |
function | |||||||||||||||||||||||
errorCallback |
function | |||||||||||||||||||||||
token |
Object |
<optional> |
Optional initial OAuth2 token to use
Properties
|
(static) getToken(successCallback)
Gets the OAuth2 token
Parameters:
Name | Type | Description |
---|---|---|
successCallback |
function |
(static) isChallenge(response)
Determines if this is an OAuth2 challenge
Parameters:
Name | Type | Description |
---|---|---|
response |
Object |
Returns:
true if this is a challenge
(static) isChallenge(response)
Determines if this is an SAML2 challenge
Parameters:
Name | Type | Description |
---|---|---|
response |
Object |
Returns:
true if this is a challenge
(static) isProtectedEndpoint(url)
Determines if the OAuth2 token should be sent to the provided URL
Parameters:
Name | Type | Description |
---|---|---|
url |
String | The URL to check |
Returns:
True if it is safe to provide the access token to the provided URL.
(static) removeEventListener(type, listener)
Removes the event listener previously registered
Parameters:
Name | Type | Description |
---|---|---|
type |
String | A string representing the event type to remove. |
listener |
function | The function to remove from the event target. |