Namespace: OAuth2

sap.AuthProxy. OAuth2

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 a SAML session with the server. This will show a webview.
Parameters:
Name Type Description
successCallback function
errorCallback function

(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) disable(successCallback, errorCallback)

Disable SAML2 challenge support
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) enable(config, successCallback, errorCallback, tokenopt)

Enables OAuth2 challenge support
Parameters:
Name Type Attributes Description
config Object The OAuth2 config
Properties
Name Type Description
protectedEndpointURL String The server that the token should be used with.
authorizationEndpointURL String
clientID String
redirectURL String
tokenEndpointURL String
requestingScopes Array.<String>
successCallback function
errorCallback function
token Object <optional>
Optional initial OAuth2 token to use
Properties
Name Type Attributes Description
access_token Object <optional>
The OAuth2 access token. Should be used as a Bearer credential.
refresh_token Object <optional>
The OAuth2 refresh token. Can be used to obtain a fresh access token.

(static) getToken(successCallback)

Gets the OAuth2 token
Parameters:
Name Type Description
successCallback function

(static) isChallenge(response)

Determines if this is an SAML2 challenge
Parameters:
Name Type Description
response Object
Returns:
true if this is a challenge

(static) isChallenge(response)

Determines if this is an OAuth2 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.