Invalid argument in authentication request
Last edited by Newbie991609 20 Mar 2024 19:53.Hi! I'm trying to authenticate using POST request, but got response "Invalid argument" and code 301.
I'm generating random int using "self.rand_int = randint(0, (1 << 32) - 1)", also I tried to use "2144632130" value, which I get in documentation, but nothing changed.
My code given below:
def get_token(self): rand_int = 2144632130 api_address = f"https://{self.get_ip_address}:7443/sangforinter/v1/auth/party/login?verify=False" auth_string = hashlib.sha1(f"{rand_int}{self.get_password}sangfor3party{self.get_username}".encode('utf-8')).hexdigest() data = { 'rand': rand_int, 'userName': self.get_username, 'clientProduct': '', 'clientVersion': '', 'clientId': '', 'desc': '', 'auth': auth_string, 'platformName': self.get_platform_name } response = post(url=api_address, data=data, verify=False) return response.text
Any help would be very appriciated. Thanks in advance! HiHi,
To save time, I suggest reaching out to Sangfor support for further assistance. Hi,
It is best to consult or contact Sangfor Support directly for immediate support and resolution of your concern Hey there,
For quick help and a fix to your issue, it's best to reach out to Sangfor Support directly. seems complex problem. please engage support. have u try chat gpt? i think u might need to get help from the support. because the chatgpt user also cannot give answer this time.:P HI, where are you trying to authenticate? Please add more details to this issue. You are trying to authenticate using a POST request with some authentication parameters, but you are encountering an "Invalid argument" response with a status code of 301. This error can be due to various reasons, such as incorrect data formatting, missing parameters, or server-side issues.
Please contact Sangfor Support Team for support Hi,
To debug better this error, i sugest you to try using "Postman". Based on this issue, you need to adjust the "rand_int" to a 32-bit number, and the code you provide only generates a 10-bit number for "rand_int".
For more information, you may refer to the below link:
https://knowledgebase.sangfor.com/detailPage?articleData=%7B%22articleType%22%3A1,%22articleId%22%3A%220160999def0845babefc4d1299184a7a%22,%22keyword%22%3A%22API%22%7D
If the problem persists, please don't hesitate to reach out to us at tech.support@sangfor.com, and we'll be more than happy to assist you further with resolving this issue.
page:
[1]
2