Get/create user-specific credentials to access external datasource in user-macro

I'm using AJAX in user-macro's to display data from an external database on confluence pages. Now I'd like to show user-specific data from that external database, preferably without the confluence-user having to enter a username and password.

I don't have much experience with velocity or java, so I'm not sure which way to go. I'm thinking about getting the confluence-username in velocity, encrypt it in velocity, and use it that to authenticate with the external database. But what type of encryption is possible in velocity?

Or maybe there is another user-specific variable available in the velocity contexts, so I can use that along with the username to authenticate?

Or should I go with a completely different approach?

1 answer

This widget could not be displayed.

Consider using the Confluence SQL Plugin it uses application server datasources. Use the Confluence Cache Plugin for performance reasons.

I'm not sure if I explained it clear enough, but the SQL plugin wouldn't solve my problem, looking at this issue: https://bobswift.atlassian.net/browse/SQL-11 . That and my datasource only works with AJAX/JSONP.

The Confluence Cache Plugin looks promising. I was also thinking about using your Script Plugin to use Beanshell to encrypt the username. Too bad the plugins are not yet compatible with Confluence 4.2.4.

Ok. All these plugins are compatible with 4.x including 4.2. Marketplace should be automatically updating the point release compatibility for plugins, but isn't at the moment. I correct when someone mentions it.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in Teamwork

What teamwork quotes inspire you?

Hey everyone! My name is Natalie and I'm an editor of the Atlassian Blog and I've got a question for you: What's your favorite quote about teamwork?  We've compiled a list here, along with...

110 views 15 7
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