HttpBasicAuthAgent Class
Creates an instance of HttpBasicAuthAgent object Auth agent handles low level implementation of authorization workflow
Constructor
HttpBasicAuthAgent
-
[credentials]
Parameters:
-
[credentials]Object optionalobject literal containg credentials for the REST service access
-
loginStringuser login
-
passwordStringuser password
-
Item Index
Methods
authenticateRequest
-
request -
done
Hook to allow the modification of any request, for authentication purposes, before sending it out to the backend
Parameters:
-
requestRequest -
doneFunction
ensureAuthentication
-
done
Called every time a new request cycle is started, to ensure those requests are correctly authenticated.
A cycle may contain one or more queued up requests
Parameters:
-
doneFunctionCallback function, which is to be called by the implementation to signal the authentication has been completed.
isLoggedIn
-
done
Checks whether the user is logged in. For HttpBasicAuthAgent, it actually tries to load the root resource with the provided credentials.
Parameters:
-
doneFunction
logIn
-
done
Logs in the user by trying to load the root resource, it is the same as HttpBasicAuthAgent.isLoggedIn
Parameters:
-
doneFunction
logOut
-
done
Log out No actual logic for HTTP Basic Auth
Parameters:
-
doneFunction
setCAPI
-
CAPI
Set the instance of the CAPI to be used by the agent
Parameters:
-
CAPICAPIcurrent instance of the CAPI object
setCredentials
-
credentials
Set the credentials
Parameters:
-
credentialsObject-
loginString -
passwordString
-
Properties
_login
String
protected
The login
Default: ""
_password
String
protected
The password
Default: ""
