The Panda Authentication System is designed to seamlessly integrate with Python development, offering robust user authentication and security features. Tailored specifically for Python developers, Panda Authentication provides easy implementation of user registration, login, and key management functionalities. Whether you're building a web service or an application, Panda Authentication ensures smooth integration and enhanced security for your users.
⚠️ WARNING: This Documentation is Outdated. We're currently Updating the Library for New Python Version.
Python Code / Documentation:
import requestsimport hashlib#Replace the Identifier with your own identifieridentifier ="pandadevkit"#Get your API Token on Hub Settings (Required) For Security onlyAPIToken =""#--------------------------------------------------# We use IP Address as our HWID, You can replace it with UUID / Hardware ID & etc as long you# have knowledge of Python.#--------------------------------------------------deffetch_ip(): response = requests.get(f"https://pandadevelopment.net/serviceapi?service={identifier}&command=getuseripaddress")if response.status_code ==200:return response.text.strip()# Return the raw text responseelse:returnNonedefhash_ip(ip_address):return hashlib.sha256(ip_address.encode()).hexdigest()#--------------------------------------------------#Function ( Get the Key URL )#--------------------------------------------------defgenerate_key(): hwid =hash_ip(fetch_ip()) url =f"https://pandadevelopment.net/getkey?hwid={hwid}&service={identifier}"return url#--------------------------------------------------#Function ( Validate the Key alongside with the Hardware ID ) #--------------------------------------------------defvalidate_key_hwid(key,hwid): url =f"https://pandadevelopment.net/v2_validation?hwid={hwid}&service={identifier}&key={key}" response = requests.get(url)if response.status_code ==200:print("Raw response from validate_key_hwid:", response.text)# Debugging linetry:return response.json()except requests.exceptions.JSONDecodeError as e:print("JSON decode error:", e)returnNoneelse:returnNone#--------------------------------------------------#Example Code ( You can run this on console )#--------------------------------------------------defmain():print("Generated Key URL: "+generate_key()) key =input("Enter your key: ") hwid =hash_ip(fetch_ip()) validation_response =validate_key_hwid(key, hwid)if validation_response: v2_authentication = validation_response.get("V2_Authentication", "Not Found") key_info = validation_response.get("Key_Information", {}) expires_at = key_info.get("expiresAt", "Not Found") premium_mode = key_info.get("Premium_Mode", "Not Found")print(f"V2_Authentication: {v2_authentication}")print(f"Expires At: {expires_at}")print(f"Premium Mode: {premium_mode}")else:print("Failed to validate key and HWID.")if__name__=="__main__":main()