Unable to access $remoteUser or $action.remoteUser in a macro through XML-RPC API

XMLWordPrintable

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

      userMacro
      ## @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:

      user_listing.py
      #!/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:

      user_listing.rb
      #!/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?

            Assignee:
            Unassigned
            Reporter:
            William Schneider
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: