How to mask a password in macro browser?

During insertion of a plugin macro in Confluence page, a password is input through Macro Browser by the editor of the page and the password remains exposed to other editor of the same Confluence page.

That's why it's better to mask the password. But the parameter options seem to have no such facilities presently.

What I need is support for type="password" as parameter options.

If suitable parameters option is not available, what is the alternative?

6 answers

1 accepted

0 vote
Davin Studer Community Champion Feb 24, 2017

So, there are a couple things that you should think about regarding this since you are developing the add-on yourself. If you truly want to hide the password from your users, then you probably don't want to do this the way you are thinking as the password would be stored in clear text in the Confluence storage format (which is easily accessible from https://yourserver/plugins/viewstorage/viewpagestorage.action?pageId=#####). Not only that your users could easily get the password with a very small amount of javascript run from the browser's dev console. A more typical approach would be to create a place in Confluence Admin where an admin could create canned SQL connections. Then in your macro you provide your users a drop down to select which connection they want. That would be a better method to secure your passwords. The way you are going about it would not be secure at all.

0 vote
Davin Studer Community Champion Feb 22, 2017

What macro of what add-on is this for?

It's a macro plugin for Confluence to query external database. Its parameter list goes like this in file "atlassian-plugin.xml":

<xhtml-macro name="database-query" class="com.atlassian.tutorial.macro.DatabaseQuery" key="database-query-macro">
<description key="database-query.macro.desc"/>
<category name="formatting"/>
<parameter name="Database_Type" type="enum">
<value name="MySql"/>
<value name="Oracle"/>

<parameter name="Host_Name" type="string"/>

<parameter name="Port" type="string"/>

<parameter name="SID_or_DB" type="string"/>

<parameter name="User_Name" type="string"/>

<parameter name="Password" type="username"/>

<parameter name="SQL" type="string"/>


At the end macro (JAR file) is added by add-on manager. When the macro is inserted to a Confluence page, Macro browser is opened to get the parameters (before preview).

The macro plugin works fine. Only problem is password field is exposed to other users also because it's not masked (what is done by a type "password" filed in html).

Is my description of the problem enough to understand?

Please reply.

0 vote
Davin Studer Community Champion Feb 23, 2017

What is the add-on name, or is this something y'all have made yourselves?

I'm using confluence SDK environment for plugin development. My plugin is based on the setup created by the command "atlas-create-jira-plugin-module".

Thanks for clear explanation. I would try to create data sources in Confluence Admin to be later used from application.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

2,792 views 26 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you