Passing Credentials in Madbuild When Publishing Output
If you are using the command line to publish output from Flare Desktop to another location, you can include credentials (i.e., user names, passwords) in your madbuild commands. You can put credential fields directly in a madbuild command, or you can put them in a separate JSON file, which is easier to read.
Passing credentials in madbuild can be done for:
-
FTP
-
MadCap Flare Online
-
Salesforce®
-
ServiceNow®
-
SFTP
-
Zendesk
Note If a destination file is associated with a target, the output will automatically be published to that destination when using a madbuild command.
[Menu Proxy — Headings — Online — Depth3 ]
Credential Fields
Here are the supported credential fields.
Field |
Description |
---|---|
username |
The user name for basic authentication. |
password |
The password for basic authentication. Note For Salesforce®, the password is that you use in a command is actually the password plus the token appended at the end of it. You can generate the token in Salesforce® from My Settings > Personal > Reset My Security Token. Note For Zendesk, "Password Access" needs to be enabled from API settings in Zendesk in order for it to work. Also, with Zendesk you have the option of using a token only, as opposed to using the username and password. For more details on this, see the following: Copy
|
Credential URL Formats
Here are the formats for including credential fields, depending on the type of destination.
Destination |
Format |
---|---|
FTP and SFTP |
Copy
Note This is the same as what you enter in the Host Name and Directory fields in the Destination Editor. |
MadCap Flare Online |
Copy
|
Salesforce® |
If your are publishing to a regular Salesforce® instance: Copy
If you are publishing to a sandbox Salesforce® instance: Copy
|
ServiceNow® |
Copy
|
Zendesk |
Copy
|
Passing Credentials in Madbuild Command
In this case, you put the credentials directly into your madbuild command.
madbuild -project "C:\MyProjectFolder\MyProject.flprj" -target "MyTargetName"
-credentials "{\"https://url.com/dir\": {\"username\":\"myusername\", \"password\":
\"mypassword\"}, \"https://anotherurl.com/dir\": {\"username\":\"myusername\",
\"password\":\"mypassword\"} }"
Example – FTP
madbuild -project "C:\CoolProject\CoolProject.flprj" -target "HelpSystem"
-credentials "{\"https://docs.fictionsoft.com/flareoutputs/helpsystem\":
{\"username\":\"ldobler\", \"password\": \"sayanything\"} }"
Example – MadCap Flare Online
madbuild -project "C:\CoolProject\CoolProject.flprj" -target "HelpSystem"
-credentials "{\"https://portal.madcapcentral.com/\":
{\"username\":\"breynolds@fictionsoft.com\", \"password\": \"Bandit77!\"} }"
Example – Salesforce®
madbuild -project "C:\CoolProject\CoolProject.flprj" -target "HelpSystem"
-credentials "{\"https://login.salesforce.com/services/oauth2/authorize\":
{\"username\":\"pete@fictionsoft.com\", \"password\":
\"HeDoneRunnoft!Fj4bGioaIWS9OPakVCedIjk2\"} }"
Example – ServiceNow®
madbuild -project "C:\CoolProject\CoolProject.flprj" -target "HelpSystem"
-credentials "{\"https://docs52164.service-now.com/oauth_token.do\":
{\"username\":\"steve.zissou\", \"password\": \"CompanyBondStooge!\"} }"
Example – SFTP
madbuild -project "C:\CoolProject\CoolProject.flprj" -target "HelpSystem"
-credentials "{\"https://myappserver05:0101/flareoutputs/helpsystem\":
{\"username\":\"jlebowski\", \"password\": \"thedudeabides\"} }"
Example – Zendesk
madbuild -project "C:\CoolProject\CoolProject.flprj" -target "HelpSystem"
-credentials "{\"https://docs-fictionsoft.zendesk.com/oauth/authorizations/new\":
{\"username\":\"westley@fictionsoft.com\", \"password\": \"AsYouWish!\"} }"
Example – Multiple Destinations (FTP and Salesforce®)
madbuild -project "C:\CoolProject\CoolProject.flprj" -target "HelpSystem"
-credentials "{\"https://docs.fictionsoft.com/flareoutputs/helpsystem\":
{\"username\":\"ldobler\", \"password\": \"sayanything\"},
\"https://login.salesforce.com/services/oauth2/authorize\":
{\"username\":\"pete@fictionsoft.com\", \"password\":
\"HeDoneRunnoft!Fj4bGioaIWS9OPakVCedIjk2\"} }"
Passing Credentials in a JSON File
In this case, you put the credentials into a JSON file. Then, in your madbuild command, you point to that file.
One of the benefits of placing commands in a JSON file is that it is easier to include (and read) multiple sets of URLs and credential information in one place if you have that need.
JSON File
{
"https://url.com/dir" : {
"username": "myusername",
"password": "mypassword"
},
"https://anotherurl/dir": {
"username": "myusername",
"password": "mypassword"
}
}
Madbuild Command
madbuild -project "C:\MyProjectFolder\MyProject.flprj" -target "MyTargetName"
-credentials-file "C:\MyCredentialsFolder\MyCredentialsFile.json"
Example — Multiple Destinations
You create a file named "DestinationCredentials.json" and save it in a folder called "My-JSON-Files," at your root C: drive. In the DestinationCredentials.json file, you create commands for the different kinds of destinations (FTP, Salesforce®, ServiceNow®, SFTP, Zendesk) that can be associated with one or more projects and targets. The JSON file looks like this.
{
"https://docs.fictionsoft.com/flareoutputs/helpsystem" : {
"username": "ldober",
"password": "sayanything"
},
"https://portal.madcapcentral.com/" : {
"username": "breynolds@fictionsoft.com",
"password": "Bandit77!"
},
"https://login.salesforce.com/services/oauth2/authorize" : {
"username": "pete@fictionsoft.com",
"password": "HeDoneRunnoft!Fj4bGioaIWS9OPakVCedIjk2"
},
"https://docs52164.service-now.com/oauth_token.do" : {
"username": "steve.zissou",
"password": "CompanyBondStooge!"
},
"https://myappserver05:0101/flareoutputs/helpsystem" : {
"username": "jlebowski",
"password": "thedudeabides"
},
"https://docs-fictionsoft.zendesk.com/oauth/authorizations/new" : {
"username": "westley@fictionsoft.com",
"password": "AsYouWish!"
}
}
Then, you create a madbuild command like this:
madbuild -project "C:\CoolProject\CoolProject.flprj" -target "HelpSystem"
-credentials-file "C:\My-JSON-Files\DestinationCredentials.json"
When you run this command the output is generated for the "HelpSystem" target, and the output files are copied and placed in each of the locations specified in the JSON file.