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
-
login
Stringuser login
-
password
Stringuser 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:
-
request
Request -
done
Function
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:
-
done
FunctionCallback 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:
-
done
Function
logIn
-
done
Logs in the user by trying to load the root resource, it is the same as HttpBasicAuthAgent.isLoggedIn
Parameters:
-
done
Function
logOut
-
done
Log out No actual logic for HTTP Basic Auth
Parameters:
-
done
Function
setCAPI
-
CAPI
Set the instance of the CAPI to be used by the agent
Parameters:
-
CAPI
CAPIcurrent instance of the CAPI object
setCredentials
-
credentials
Set the credentials
Parameters:
-
credentials
Object-
login
String -
password
String
-
Properties
_login
String
protected
The login
Default: ""
_password
String
protected
The password
Default: ""