Advertisement
Hygcgggnngff

pfauth

Apr 30th, 2025
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. @app.route('/api/PlayFabAuthentication', methods=['POST'])
  2. def PlayFabAuthentication():
  3. data = request.get_json()
  4.  
  5. print(data)
  6.  
  7.  
  8. Nonce: str = data.get("Nonce", "Null")
  9. CustomId: str = data.get("OculusId", "Null")
  10. Platform: str = data.get("Platform", "Null")
  11.  
  12. BLAH = requests.post(
  13. url=
  14. f"https://{title}.playfabapi.com/Server/LoginWithServerCustomId",
  15. json={
  16. "ServerCustomId": f"OCULUS{CustomId}",
  17. "CreateAccount": True
  18. },
  19. headers={
  20. "content-type": "application/json",
  21. "x-secretkey": secretkey
  22. })
  23. if BLAH.status_code == 200:
  24. print("successful login chat!")
  25. jsontypeshi = BLAH.json()
  26. goodjson = jsontypeshi.get("data")
  27. PlayFabId = goodjson.get("PlayFabId")
  28. SessionTicket = goodjson.get("SessionTicket")
  29. Entity = goodjson.get("EntityToken")
  30. EntityToken = Entity["EntityToken"]
  31. EntityId = Entity["Entity"]["Id"]
  32. EntityType = Entity["Entity"]["Type"]
  33.  
  34. data = [
  35. PlayFabId,
  36. SessionTicket,
  37. Entity,
  38. EntityToken,
  39. EntityId,
  40. Nonce,
  41. CustomId,
  42. Platform
  43. ]
  44.  
  45. EASports = requests.post(
  46. url=f"https://{title}.playfabapi.com/Client/LinkCustomID",
  47. json={
  48. "CustomID": f"OCULUS{CustomId}",
  49. "ForceLink": True
  50. },
  51. headers={
  52. "content-type": "application/json",
  53. "x-authorization": SessionTicket
  54. })
  55. if EASports.status_code == 200:
  56. print("Ok, linked it ig")
  57. return jsonify({
  58. "PlayFabId": PlayFabId,
  59. "SessionTicket": SessionTicket,
  60. "EntityToken": EntityToken,
  61. "EntityId": EntityId,
  62. "EntityType": EntityType
  63. }), 200
  64. else:
  65. return jsonify({"Message": "Failed"}), 400
  66. else:
  67. return jsonify({"Message": "More likely banned"}), 403
  68.  
Tags: Auth
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement