Skip to content
This repository has been archived by the owner on Dec 28, 2021. It is now read-only.

RemoveFriend error - Not permitted: not authenticated #43

Open
3 tasks done
fabriciols opened this issue Aug 20, 2020 · 3 comments
Open
3 tasks done

RemoveFriend error - Not permitted: not authenticated #43

fabriciols opened this issue Aug 20, 2020 · 3 comments

Comments

@fabriciols
Copy link

fabriciols commented Aug 20, 2020

Summary

When i try to use the function RemoveFriend on a friend from my friend list, it returns:

callofduty.errors.HTTPException: HTTP 200 - Not permitted: not authenticated

I dont think this is a library problem... maybe this endpoint doesn't work anymore?

Reproduction Steps

Add this piece of code on the test.py, to try to remove the first friend of user list

    friends = await client.GetMyFriends()
    for friend in friends:
        print(f"{friend.platform.name}: {friend.username} ({friend.accountId}), Online? {friend.online}")
        await client.RemoveFriend(friend.accountId)
        break

Expected Results

A friend removed without an error

Actual Results

Traceback (most recent call last):
  File "test.py", line 266, in <module>
    asyncio.get_event_loop().run_until_complete(main())
  File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
    return future.result()
  File "test.py", line 33, in main
    await client.RemoveFriend(friend.accountId)
  File "/home/fabriciols/joysticket/CallofDuty.py/callofduty/client.py", line 1250, in RemoveFriend
    return (await self.http.RemoveFriend(accountId))["data"]
  File "/home/fabriciols/joysticket/CallofDuty.py/callofduty/http.py", line 348, in RemoveFriend
    return await self.Send(
  File "/home/fabriciols/joysticket/CallofDuty.py/callofduty/http.py", line 108, in Send
    if isinstance(data, dict):
callofduty.errors.HTTPException: HTTP 200 - Not permitted: not authenticated

Checklist

  • I have searched the open Issues for duplicates
  • I have shown the entire traceback, if possible
  • I have removed my token from display, if visible

System Information

Python 3.8.2 (default, Jul 16 2020, 14:00:26)
callofduty.py version = "1.2.1"

@EthanC
Copy link
Owner

EthanC commented Nov 27, 2020

A few endpoints seem to have changed over time, this will need investigation before it can be solved.

@fabriciols
Copy link
Author

since i posted it, i found the solution sniffing the app

The current implementation have two problems:

  1. It is a POST, not a GET
  2. You need to send an extra header: "atvi-auth" with the ACT_SSO_COOKIE

@Vartius
Copy link

Vartius commented Jan 17, 2021

since i posted it, i found the solution sniffing the app

The current implementation have two problems:

  1. It is a POST, not a GET
  2. You need to send an extra header: "atvi-auth" with the ACT_SSO_COOKIE

Sooooo, and what we should do?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants