How to enable links for non-logged in Confluence users?

I use Confluence for a subscription-based web site, and at present if users aren't logged in any links to subscriber content are disabled. This is sometimes confusing for my non-logged in users. I would like to enable the links at all times so the users are prompted to log in when necessary. Is this possible?



2 answers

1 accepted

1 vote
Answer accepted

While not the idea solution, the following is the best option I've come up with so far. I added the following Javascript in Custom HTML at the end of the page. It looks for URLs that end in # (Confluence's convention for hiding inaccessible URLs) and replaces them with one of two publicly-accessible pages on my site, depending on whether or not the user is logged in.

<script type="text/javascript">
AJS.toInit(function ($) {
        for (var ls = document.links, numLinks = ls.length, i=0; i<numLinks; i++){
            if (!!ls){
	        var l = ls[i].href;
                if (l.indexOf("#") + 1 == l.length){
                    if (AJS.params.remoteUser == ''){
                        ls[i].href= "insert login-required URL here";
                    } else {
                        ls[i].href= "insert not-covered-by-subscription URL here";

Hi Dave,

I believe you can achieve that by enabling a space to be accessed by anonymous users.

In order to set a space to be accessible by anonymous user, you need to login as confluence admin, then click on Space Tool > Permission. In Anonymous access section you click on Edit Permissions and then you can select the permission as required.

Or if you want your whole site to be accessible by anonymous users you can set your Confluence to do so too.

You might find the following document usefull:

Hope it helps.

Ah, but that's just the problem. I don't want subscriber-only spaces to be accessible by anonymous users, but I want anonymous users to see real links so that when they click on those links they're prompted to log in.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Mar 12, 2019 in Confluence

Confluence Admin Certification now $150 for Community Members

More and more people are building their careers with Atlassian, and we want you to be at the front of this wave! Important Dates Start the Certification Prep Course by 2 April 2019 Take your e...

259 views 2 10
Read article

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