-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to obtain access token #86
Comments
Same here |
I tried to get a new auth token and ran into the same thing today with |
same here, experienced this today. Works on my local machine but not on a cloud server. Is Venmo is finally locking down this api? |
Since I ran into this I decided to do some digging to see if I could hack my way through this a bit. I was able to grab a valid api token from the network tab during a payment, but this python API still didn't seem to work due to a With this 'new' token it seems like there is now a change in their payment flow - I see a new call to {
"eligible": true,
"eligibilityToken": "eyJ...",
"fees": [
{
"productUri": "venmo:product:buyer_protection:f4de...",
"appliedTo": "227...",
"feePercentage": 0,
"baseFeeAmount": 0,
"calculatedFeeAmountInCents": 0,
"feeToken": "eyJ..."
}
]
} The
Based on the current __send_or_request_money() function it doesn't seem like this token is being passed and is now something venmo requires. I've whipped up a quick local script to send in this new token (along with a |
If you log in while tracking the network requests you can also pull out both the deviceID and auth code from one of the requests and log in like this:
or
To find device_id or access_token:
I am trying to modify the code to pull this info from the request but running into some 403 errors--going to keep trying when I have some time. I don't think you need the eligibility token @ahatzz11. EDITED: I see you did this already. Going to keep trying to get the token from within code. |
Thanks to everyone for flagging this with detailed info! I'm currently tied up, but I hope to look into this next weekend! |
FWIW, I found this differently as I didn't see this particular request or any responses that included anything resembling "device_id". On the network request to |
@ahatzz11 I'm trying to recreate the same workaround but am having trouble retrieving the eligibility token (getting a 403 error each time). I'm only passing in the access_token in my post request header which I suspect is wrong... can I ask how you set the cookie and Csrf-Token header you mentioned? |
Was planning to try and maybe get a pull request in for a fix but found that when trying to log into venmo on any browser I am presented with a "Something went wrong. Try again later or contact customer support". Script must have tried too many times and locked me out. Anyone else have this for them and did you have to contact customer support? Edit: guess I was able to use an already trusted device. But it attempting to do the eligibility request, strangely enough I get the 404 error |
Sadly spend some hours on this and when trying to request through either of the following, I get a 404 error, invalid json and can't seem to figure out why: |
Further digging, I see the HTTP version is HTTP/2 from the developer tools network tab. From what I can see, the requests package only support HTTP/1.1 while another package, HTTPX, supports the new standard. Could this be a possible reason for the 403/404 errors? EDIT: after reading up on it, sounds whatever site would have to block http/1.1, which im now doubting they would do that since other folks got it to work and the tool still logs in. |
Is there any update on this thread? |
I tried, i failed... to get it to work. |
There's a way to do it I can't remember how I did it but you gotta login into your venmo account + f12 + go to networking settings + enable no throttling + find your device id through the information there and then use the access_token code in the documentation |
Yeah I found it like the previous commenter said track your networking requests then search for "auth" and there should be "device_id" and "access_token" there you can take the access_token or just use Client.get_access_token with your login details and your device id in a IDE your choice. |
Yeah, I was able to get device ID and all, but it was the eligibility token portion that I was not able to implement to get it to work. Would you care to share the code you had updated.? Or I guess did you not make any updates to the Venmo code? |
It was mentioned before but these are the steps I took to get a valid access token through this API:
|
@rbrisita Are you using the Venmo client to make any payments? I agree that it works when you follow the steps to get your device ID but the making a payment is the portion. Personally I have trouble with as I think the eligibility token needs to be implemented yet. |
@raycekar I have successfully made charge requests through the API. |
@rbrisita could you share me your script (username/password/device_id removed of course). With my script, I can alter it to include device id and get all the way to the requesting the payment and getting the following error:
FYI, trying to automate paying with a debit card and it works when manually sending the payment through the app (and I need it to the be the debit card) |
@raycekar From your error, it looks like it's the payment and not the access token. An access token error states: {
"error": {
"message": "You did not pass a valid OAuth access token.",
"code": 261,
"links": null,
"title": "Error"
}
} I would look into supplying the funding source id if you haven't already for the from venmo_api import Client
from dotenv import dotenv_values
config = dotenv_values(".env")
user_id = config.get("TARGET_USER_ID", getenv("TARGET_USER_ID"))
username = config.get("VENMO_USER", getenv("VENMO_USER"))
password = config.get("VENMO_PASS", getenv("VENMO_PASS"))
device_id = config.get("VENMO_DEVICE_ID", getenv("VENMO_DEVICE_ID")) # device id taken from a desktop browser
access_token = Client.get_access_token(
username=username,
password=password,
device_id=device_id
)
client = Client(access_token=access_token)
try:
response = client.payment.request_money(0.01, "Some Message", user_id)
except Exception as e:
print("Error:", e)
print("Response", response) |
Thank @rbrisita a ton! |
Awesome! Glad to be of help. |
Question. Is the device ID linked to a particular physical device? If I want to run the python script in a cloud service, then I can't get the device ID ahead of the time |
@jackguo709 I believe you could use any device to generate and save your access token. Then, you could skip the earlier steps and just use |
But I find that if I try to send multiple payments in a short amount of time, or Venmo someone two or three times, the payments will get denied. |
The |
Running the following code:
from venmo_api import Client
at = Client.get_access_token(username='*****************', password='***********')
getting the following response:
Error: {'error': {'links': None, 'title': 'Error', 'code': 240, 'message': 'OAuth2 Exception: Unable to complete your request. Please try again later.'}}
My friend @Dean-Katz is having the same issue.
The text was updated successfully, but these errors were encountered: