No such method: getAuthToken

85 Views Asked by At

I am trying to write a script to authenticate with a MoinMoin Wiki that is not running on my machine. I am under the assumption that my approach is correct per the information found here (see section 3.11) on the official MoinMoin wiki page.

My code is as follows:

import ssl
import xmlrpclib

def getCustomerPages():

    #list of page names:
    pageNames = []

    #setup MoinMoin:
    name = "username"
    password = "password"
    wikiUrl = "url"

    myWiki = xmlrpclib.ServerProxy(wikiUrl + "?action=xmlrpc2", allow_none = True,
    context=ssl._create_unverified_context())

    authToken = myWiki.getAuthToken(name, password)

    print(authToken)

    mc = xmlrpclib.MultiCall(myWiki)
    mc.applyAuthToken(authToken)

getCustomerPages()    

Notably, the wiki I am trying to connect to does not have a good SSL certificate. For that reason I have included the context=ssl._create_unverified_context() in xmlrpclib.ServerProxy()

When I run this code I get the error:

{'faultCode': 1, 'faultString': 'No such method: getAuthToken.'}

I have looked through other code and they appear to be using the method just fine, while having essentially the same code as I do. See here for examples of its usage.

Could someone please help me understand and fix this error?

0

There are 0 best solutions below