Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Can I get the "atl_token" ??

liljoint
Contributor
March 18, 2012

Can I get the current "atl_token" ??

Confluence 4.0.

thnx :)

3 answers

1 accepted

1 vote
Answer accepted
Andrew Frayling
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 18, 2012
liljoint
Contributor
March 18, 2012

Andrew:

#url_xsrfToken() works... thanks ;)

Like JIRA Connector likes this
1 vote
Deleted user February 1, 2017

For everyone stumbling over atl_token, which they need in order to send queries to built-in actions such as setcontentpermissions.action.

 

You can get it $('[name="atl_token"]').attr('value') on Confluence pages.

So from now on, this works:

$.get(`${location.origin}/pages/setcontentpermissions.action?viewPermissionsGroups=k15t-users&editPermissionsGroups=k15t-users&contentId=${AJS.Meta.get('draft-id')}&atl_token=${$('[name="atl_token"]').attr('value')}`)

Since AJS.safe.get() does not work, you can use the atl_token in your own requests with whatever XMLHTTPRequest fashion you want.

suedti1 February 12, 2018

Hi Martin! 

 

Do you have an idea how to add user restrictions instead of group-restriction with this method?

I found out that using ?viewPermissionsUsers=USER does not work. It only works with a long user key like this: viewPermissionsUsers=8a8a89a55365d4c6015365d5e9c913af

I can get the current user from a the meta-tag  "ajs-remote-user-key", but I don´t know how to get this key for arbitrary users. 

Thanks

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 18, 2012

Don't know. What do you mean by atl_token?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events