URL to addspacenotification.action fails with a session timeout

Hi,

I would like to embed the action to watch a blog within a space into a button for the users to use. Today you need to dig into the Space Admin section to do this which feels too complicated for regular users.

I have learned that this function does the trick:

<Confluence base-URL>/spaces/addspacenotification.action?key=<SPACEKEY>&contentType=blogpost

However, when I "run" this URL from a button (or a link) it fails with an error message saying:

The following error(s) occurred:

  • Your request could not be processed because a required security token was not present in the request. You may need to re-submit the form or reload the page.

When I examine the link in the Space Admin section it has an atl_token-parameter as well. I guess this shouldn't be part of a generic command since it is unique for my session. Is that a correct assumption?

Is there any way to workaround this issue?

We are using SSL and have an nginx load-balancer as proxy in front of Confluence.

Thanks in advance!

// Svante

2 answers

1 accepted

I have been investigating this now and found a solution!

A user macro that renders a link to the "Start Watching the Blog" action.

<a href="../../spaces/addspacenotification.action?key=$space.getKey()&contentType=blogpost&#url_xsrfToken()">Watch the $space.getName() Blog</a>

The $space-variable expands into the space-object of the space the macro has been created in. The methods getKey() and getName() give me the information needed.

The velocity template #url_xsrfToken() expands into "atl_token=[looooong session identifier]"

This works well and can be used in any space.

Now I shall work on the layout of the link. I actually want a nice-looking button instead!

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...

370 views 20 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