You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
systemName - System name the application belongs to.
37
37
38
-
password - Password to use for login.
38
+
applicationName - Application name.
39
+
40
+
cdpVersion - CDP version the application is built with.
41
+
42
+
systemUseNotification - System use notification message to ask for confirmation to continue.
43
+
44
+
- Returns
45
+
46
+
The created Request object.
47
+
48
+
Instance Methods / Request
49
+
~~~~~~~~~~~~~~~~~~~~~~~~~~
50
+
51
+
request.systemName()
52
+
^^^^^^^^^^^^^^^^^^^^
53
+
54
+
- Returns
55
+
56
+
System name the application belongs to.
57
+
58
+
request.applicationName()
59
+
^^^^^^^^^^^^^^^^^^^^^^^^^
60
+
61
+
- Returns
62
+
63
+
Application name.
64
+
65
+
request.cdpVersion()
66
+
^^^^^^^^^^^^^^^^^^^^
67
+
68
+
- Returns
69
+
70
+
CDP version the application is built with.
71
+
72
+
request.systemUseNotification()
73
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
39
74
40
75
- Returns
41
76
42
-
The created AuthRequest object with provided login data.
77
+
System use notification message to ask for confirmation to continue.
43
78
44
79
45
-
studio.api.Client(uri)
46
-
^^^^^^^^^^^^^^^^^^^^^^^
80
+
studio.api.Client(uri, notificationListener)
81
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
47
82
48
83
- Arguments
49
84
50
85
uri - String containing the address and port of StudioAPI server separated by colon character
51
86
52
-
authenticate - Function authenticate(lastAttemptMessage) returning a Promise.<AuthRequest> containing userID and password for authentication
87
+
notificationListener - Object returning two functions: applicationAcceptanceRequested(studio.api.Request) and credentialsRequested(studio.api.Request).
88
+
Function applicationAcceptanceRequested must return a Promise of void. Can be used to popup system use notification message and ask for confirmation to continue.
89
+
Function credentialsRequested must return a Promise of dictionary containing 'Username' and 'Password' as keys for authentication.
53
90
54
91
- Returns
55
92
@@ -70,15 +107,24 @@ studio.api.Client(uri)
70
107
71
108
.. code:: javascript
72
109
73
-
// Create client with authentication connected to uri provided in browser address bar.
74
-
// The authenticator is only called when page requires a login.
75
-
varauthenticator=function(loginMessage) {
110
+
// Create client with NotificationListener connected to uri provided in browser address bar.
111
+
// The NotificationListener is only called when page requires a login.
112
+
113
+
classNotificationListener {
114
+
applicationAcceptanceRequested(request) {
76
115
returnnewPromise(function(resolve, reject) {
77
-
//Do something to get username and password variables
* @param studioURL String containing the address and port of StudioAPI server separated by colon character
969
-
* @paramauthenticate Function authenticate(lastAttemptMessage) returning a {Promise.<AuthRequest>} containing userID and password for authentication
981
+
* @paramnotificationListener Object returning two functions: applicationAcceptanceRequested(AuthRequest) and credentialsRequested(AuthRequest). Function credentialsRequested must return a Promise of dictionary containing 'Username' and 'Password' as keys for authentication.
0 commit comments