Why can my API call show GlobalProtect users but cannot disconnect them?

Reply
L1 Bithead

Why can my API call show GlobalProtect users but cannot disconnect them?

Help Needed! I've been having this issue for a while now. I have a ticket open; yet, I am not able to get this API call to disconnect the connected GP gateway users. It's throwing me an 'invalid username' error each time, when I try to force-logout the user.

 

Any help spotting the issue is appreciated!

 

>>> kickOut = requests.get('https://labfirewall.example.com/api/?type=op&key=MYKEYHERE&cmd=<request><global-protect-gateway><client-logout><user>theuser</user><reason>force-logout</reason><gateway>Dummy_Gateway-N</gateway><computer>MACHINENAME</computer></client-logout></global-protect-gateway></request>')
>>> soup = bs(kickOut.content, 'html.parser')
>>> print(soup)
<response status="success"><result>
<response status="error">
<gateway>Dummy_Gateway-N</gateway>
<user>theuser</user>
<computer>MACHINENAME</computer>
<error>Invalid user name</error>
</response>
</result></response>
>>>
L1 Bithead

Re: Why can my API call show GlobalProtect users but cannot disconnect them?

I was missing the <domain>exampledomain</domain<> parameter in my API call

Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the Live Community as a whole!

The Live Community thanks you for your participation!