-
Type:
Bug
-
Resolution: Won't Fix
-
Priority:
Low
-
None
-
Affects Version/s: 3.5.13, 4.0
-
Component/s: Editor - Page / Comment Editor
-
Environment:
Confluence 3.5.13, Confluence Shibboleth Authenticator 2.0.1, Custom Space User Management Plugin 2.2.1
As a system admin for confluence, I created a simple user macro for testing purposes, which outputs the $remoteUser, $action.remoteUser, and $req.getRemoteUser() (just to see what each results in).
## @noparams $remoteUser $action.remoteUser $req.getRemoteUser()
When added to a page (within my personal space), all display the logged in user when viewed within confluence. When using the XML-RPC API, however, I only see the text '$remoteUser', $action.remoteUser' etc within <div id="ConfluenceContent">(STUFF SHOWS HERE)</div>. The remote call is done using the following Confluence XML-RPC API calls in python:
#!/usr/bin/python
import xmlrpclib
import getpass
import sys
CONFLUENCE_URL='https://example.confluence.com/rpc/xmlrpc'
CONFLUENCE_LOGIN='admin'
CONFLUENCE_PASSWORD='PASSWORD'
SPACE_TOKEN="~personal_space_token"
PAGE_NAME="userlisting"
client = xmlrpclib.Server(CONFLUENCE_URL,verbose=0)
authToken=client.confluence1.login(CONFLUENCE_LOGIN,CONFLUENCE_PASSWORD)
pageObject=client.confluence1.getPage(authToken,SPACE_TOKEN,PAGE_NAME)
renderedPage=client.confluence1.renderContent(authToken,SPACE_TOKEN,pageObject['id'],'',{'style':'clean'})
print renderedPage
client.confluence1.logout(authToken)
and, in ruby just to make sure it wasn't anything weird in python:
#!/usr/bin/ruby
require 'xmlrpc/client'
CONFLUENCE_URL = 'https://example.confluence.edu/rpc/xmlrpc'
CONFLUENCE_LOGIN = 'admin'
CONFLUENCE_PASSWORD = 'PASSWORD'
SPACE_TOKEN = "~personal_space_token"
PAGE_NAME = "userlisting"
client = XMLRPC::Client.new_from_uri(CONFLUENCE_URL).proxy("confluence1")
# hackity hack hack
client.instance_variable_get("@server").instance_variable_get("@http").verify_mode = OpenSSL::SSL::VERIFY_NONE
token = client.login(CONFLUENCE_LOGIN, CONFLUENCE_PASSWORD)
page = client.getPage(token,SPACE_KEY,PAGE_NAME)
rendered = client.renderContent(token,SPACE_KEY,page['id'],'', {"style" => "clean"})
puts rendered
client.logout(token)
The user I log in as through the XML-RPC API is a core Confluence configured user (admin user), whereas all other users in the system are retrieved through LDAP. Not sure if this matters. I am not sure if this is an expected behavior, in which case is there any way of displaying the user from the XML-RPC API through a custom user macro?