1.1. Credential: Use to store a username and a password
//---------------------------------------------------
// Declare system URL
//---------------------------------------------------
ctx.workflow('wf_LaunchApplication', 'eb0723d7-dd22-4093-ab04-c2561a664b79') ;
// Declare system URL
ctx.setting({ SystemURL: {
comment: "My setting for URL",
server: true
}});
//---------------------------------------------------
// Declare system credential
//---------------------------------------------------
ctx.workflow('wf_LaunchApplication', '053411d2-6176-476c-9527-a6e1ccb2f512') ;
// Declare system credential
ctx.cryptography.credential({ SystemCredential: {
comment: "Username and Password",
server: true
}});
//---------------------------------------------------
// Declare system language
//---------------------------------------------------
ctx.workflow('wf_LaunchApplication', 'eb0723d7-dd22-4093-ab04-c2561a664c98') ;
// Declare system language
ctx.setting({ SystemLanguage: {
comment: "Login Language",
server: true
}});
// ----------------------------------------------------------------
// Step: Get_credential
// ----------------------------------------------------------------
Logon.step({ Get_credential: function(ev, sc, st) {
var rootData = sc.data;
ctx.workflow('wf_LaunchApplication', '24ae4149-b225-4d53-afb7-04e0e4367f7c') ;
// Get credential
ctx.cryptography.credentials.SystemCredential.get(function(code, label, credential) {
if (code == e.error.OK) {
// TODO : set login/password here
rootData.username = credential.userName.get();
rootData.password = credential.password.get();
ctx.log("Username:" + rootData.username);
ctx.log("Password:" + rootData.password);
sc.endStep(); // Start_Logon
return;
}
});
}});
// ----------------------------------------------------------------
// Step: Get_setting
// ----------------------------------------------------------------
Logon.step({ Get_setting: function(ev, sc, st) {
var rootData = sc.data;
ctx.workflow('wf_LaunchApplication', '6f806c6c-e08d-45fc-a07d-d7f0f1ac2079') ;
// Get setting
ctx.settings.SystemURL.get(function(code, label, setting) {
if (code == e.error.OK) {
// get value from setting.value
rootData.URL = setting.value;
ctx.log("URL:" + rootData.URL);
sc.endStep(); // Get_credential
return;
}
});
}});
// ----------------------------------------------------------------
// Step: Start_Logon
// ----------------------------------------------------------------
Logon.step({ Start_Logon: function(ev, sc, st) {
var rootData = sc.data;
ctx.workflow('wf_LaunchApplication', '15b60db0-e383-4833-b2b2-931ad8896e15') ;
// Start 'Logon'
Logon.navigator = e.navigator.Chrome;
Logon.start(rootData.URL,null,null,e.launchFlag.ShowMaximized);
sc.endStep(); // pLogon_management
return;
}});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
37 | |
25 | |
17 | |
13 | |
7 | |
7 | |
7 | |
6 | |
6 | |
6 |