Zimbra-Community / python-zimbra

Core framework for easily sending requests to the Zimbra SOAP-API
BSD 2-Clause "Simplified" License
63 stars 26 forks source link

"permission denied: need adequate admin token" issue #35

Open ankitcodes4u opened 2 years ago

ankitcodes4u commented 2 years ago

This is the request that I am sending to zimbra server. And I am using postman for testing this

This is zimbra " Zimbra 9.0.0_ZEXTRAS_20210811 (build 20210830124411) " that I am running in server

I have generate authToken using a username which as administrative access.

Can anyone have solution to this problem?

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
   <soap:Header>
      <context xmlns="urn:zimbra">
         <authToken>0_XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</authToken>
      </context>
   </soap:Header>
   <soap:Body>
        <CreateAccountRequest xmlns="urn:zimbraAdmin" name="testuser@example.com">
            <a n="displayName">Test User</a>
            <password>testpassword</password>
        </CreateAccountRequest>
   </soap:Body>
</soap:Envelope>

This is the error that I am getting

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header>
        <context xmlns="urn:zimbra">
            <change token="26999"/>
        </context>
    </soap:Header>
    <soap:Body>
        <soap:Fault>
            <soap:Code>
                <soap:Value>soap:Sender</soap:Value>
            </soap:Code>
            <soap:Reason>
                <soap:Text>permission denied: need adequate admin token</soap:Text>
            </soap:Reason>
            <soap:Detail>
                <Error xmlns="urn:zimbra">
                    <Code>service.PERM_DENIED</Code>
                    <Trace>qtp195615004-132:1651166999211:fedd1b5adb872a47</Trace>
                </Error>
            </soap:Detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>