Freemarker Function - get_preferences

524 views
Skip to first unread message

vickir...@gmail.com

unread,
Oct 21, 2014, 2:42:22 AM10/21/14
to suppor...@runmyprocess.com
As usual I am probably coding freemarker incorrectly. It is just too forgiving!!!

I am changing all my passwords in different authentication connectors (google spreadsheet and salesforce) to secure user preferences so I have some level of security when showing the development of processes to others. Unfortunately I receive an NULL/BLANK PASSWORD when I use the following script and the errors:

2014-10-21T06:18:22+0000 - Task "Authenticate to Google Spreadsheets" (id: 1[0] - status: ACTIVE): Forbidden

The P_result.error is {"Error":"BadAuthentication"}

The Input variable script for the variable password is:

<#assign passwords = get_preferences()>
password = passwords.googlespreadsheetpassword


I tried the second line with "$" and "{" etc. but to no avail.


thoshino

unread,
Oct 21, 2014, 12:09:01 PM10/21/14
to suppor...@runmyprocess.com, vickir...@gmail.com
Hi Vicki,

${get_preferences()}
returns something like this
{"testpreference2":"2222222","testpreference1":"333333333"}
so, if you just wanted to pass 2222222 as password, you can do

<#assign passwords = get_preferences()>
${passwords.testpreference2}

And name the script "password".
Here, name means, in process diagram, in box for input variable, you name your variable + write  the script.

Also, you can check "secured" for the variable, and it will be ***** in process report, so even Admins can't see the password.

And lastly but very important, if you plan for a production application, please use OAuth2.0 tokens.
These are more secure and disposable (you will not expose any password, and token can be refreshed without affecting any other authentication).

Best regards,

Taka

Sabine El Rassy

unread,
Oct 21, 2014, 12:14:24 PM10/21/14
to RunMyProcess Support Forum, vickir...@gmail.com
Hello Vicki,

If your preference 'password' is set as a secured preference, you cannot call the get_preferences().googlespreadsheetpassword within the context of your process. The only way you can use it, is to use get_preferences().googlespreadsheetpassword  directly in your connector or your provider.


Regards

Sabine EL RASSY

Project Manager
Tel        : +33 (0) 1 75 77 51 76

     
Fujitsu RunMyProcess user? Please add a review on GoogleApps Marketplace

Afin de contribuer au respect de l'environnement, merci de n'imprimer ce message qu'en cas de nécessité.
Be environmentally friendly: do not print this email unless it is entirely necessary.

--
Fujitsu - RunMyProcess
---
You received this message because you are subscribed to the Google Groups "RunMyProcess Support Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to supportforum...@runmyprocess.com.
To post to this group, send email to suppor...@runmyprocess.com.
Visit this group at http://groups.google.com/a/runmyprocess.com/group/supportforum/.
To view this discussion on the web visit https://groups.google.com/a/runmyprocess.com/d/msgid/supportforum/0bde50c7-8c42-4823-bdb3-5f5b78533bf7%40runmyprocess.com.

vickir...@gmail.com

unread,
Oct 21, 2014, 9:01:29 PM10/21/14
to suppor...@runmyprocess.com, vickir...@gmail.com


I am confused. The documentation says I can use the get-preferences in a processes input varables FOR a SECURE USER PREFERENCE but Sabine says it can only be in the connector URL. It is important because it is not only the process reports where I need to "hide" passwords but also in the whole development process as I demonstrate this and do not want to see the password anywhere.

thoshino

unread,
Oct 22, 2014, 12:20:04 AM10/22/14
to suppor...@runmyprocess.com
For later reference, here is the solution.

User preference can be edited by user himself/herself only.
It can be edited in My setting (upper right corner), first tab "User settings", bottom tab "Preferences".

It cannot be modified from Account > User menu, even if you edit and save, the data will not be saved. (here, you can modify metadata - if you are an admin)

${get_preferences().non_secured_data}
can be used anywhere in process or Connector, or Provider.

${get_preferences().secured_data}
cannot be used in process, it will be regarded undefined.

You can write this syntax in Connector url or Provider authentication setting to use as password.

Best regards,

Taka

ebort...@mauacapital.com

unread,
Sep 27, 2018, 8:45:28 AM9/27/18
to Fujitsu RunMyProcess Developer Community, thos...@runmyprocess.com
Can I put ${get_preferences(variable).secured_data} in the password field of the connector?

I am asking this because I received an error trying this.

Best regards,

Eduardo

Reply all
Reply to author
Forward
0 new messages