Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route('/api/PlayFabAuthentication', methods=['POST'])
- def PlayFabAuthentication():
- data = request.get_json()
- print(data)
- Nonce: str = data.get("Nonce", "Null")
- CustomId: str = data.get("OculusId", "Null")
- Platform: str = data.get("Platform", "Null")
- BLAH = requests.post(
- url=
- f"https://{title}.playfabapi.com/Server/LoginWithServerCustomId",
- json={
- "ServerCustomId": f"OCULUS{CustomId}",
- "CreateAccount": True
- },
- headers={
- "content-type": "application/json",
- "x-secretkey": secretkey
- })
- if BLAH.status_code == 200:
- print("successful login chat!")
- jsontypeshi = BLAH.json()
- goodjson = jsontypeshi.get("data")
- PlayFabId = goodjson.get("PlayFabId")
- SessionTicket = goodjson.get("SessionTicket")
- Entity = goodjson.get("EntityToken")
- EntityToken = Entity["EntityToken"]
- EntityId = Entity["Entity"]["Id"]
- EntityType = Entity["Entity"]["Type"]
- data = [
- PlayFabId,
- SessionTicket,
- Entity,
- EntityToken,
- EntityId,
- Nonce,
- CustomId,
- Platform
- ]
- EASports = requests.post(
- url=f"https://{title}.playfabapi.com/Client/LinkCustomID",
- json={
- "CustomID": f"OCULUS{CustomId}",
- "ForceLink": True
- },
- headers={
- "content-type": "application/json",
- "x-authorization": SessionTicket
- })
- if EASports.status_code == 200:
- print("Ok, linked it ig")
- return jsonify({
- "PlayFabId": PlayFabId,
- "SessionTicket": SessionTicket,
- "EntityToken": EntityToken,
- "EntityId": EntityId,
- "EntityType": EntityType
- }), 200
- else:
- return jsonify({"Message": "Failed"}), 400
- else:
- return jsonify({"Message": "More likely banned"}), 403
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement