AndreMiras / mysodexo

Mysodexo Python client
https://medium.com/@andre.miras/reverse-engineering-sodexos-api-d13710b7bf0d
MIT License
11 stars 0 forks source link

Systematic login failure #3

Open FilipDem opened 2 years ago

FilipDem commented 2 years ago

Hi Andre, Is this sodexo project still working? When using I got always an error back on the login ("bad request"). I added some tracing to see what exactly happened and you can find it below. Thanks for feedback! send: b'POST /en/v3/connect/login HTTP/1.1\r\nHost: sodexows.mo2o.com\r\nUser-Agent: python-requests/2.25.1\r\nAccept-Encoding: gzip, deflate\r\nAccept: application/json\r\nConnection: keep-alive\r\nContent-Length: 108\r\nContent-Type: application/json\r\n\r\n' send: b'{"username": "filip.xxxxxxxx@gmail.com", "pass": "xxxxxxxxxxx", "deviceUid": "device_uid", "os": 0}' reply: 'HTTP/1.1 400 Bad Request\r\n' header: Date: Wed, 20 Oct 2021 18:53:01 GMT header: Server: Apache header: Set-Cookie: PHPSESSID=mbsueaor4feu8fpl2qo17c61fu; expires=Tue, 18-Jan-2022 18:53:03 GMT; Max-Age=7776000; path=/ header: Cache-Control: no-cache, private header: Connection: close header: Transfer-Encoding: chunked header: Content-Type: application/json

AndreMiras commented 2 years ago

Hi Filip, Thanks for the report, I just gave it a try now and it works:

mysodexo --balance
email: andre.<hidden>@gmail.com
password: 
<hidden>******<hidden>: 58.69

Do you have a Spanish Sodexo account? https://www.mysodexo.es/ Don't you get more from the stacktrace? Like knowing the response body would be helpful. I see status code is 400, but response body is also important

FilipDem commented 2 years ago

This is probably the problem. I have an account in Belgium... And probably this is not the same... Thanks anyway for your reaction! I could imagine that it would be country-dependent, but I think you confirmed indirectly. F

Op do 21 okt. 2021 om 11:46 schreef Andre Miras @.***>:

Hi Filip, Thanks for the report, I just gave it a try now and it works:

mysodexo --balance email: @.*** password:

******: 58.69 Do you have a Spanish Sodexo account? https://www.mysodexo.es/ Don't you get more from the stacktrace? Like knowing the response body would be helpful. I see status code is 400, but response body is also important — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or unsubscribe . Triage notifications on the go with GitHub Mobile for iOS or Android .
AndreMiras commented 2 years ago

Makes sense indeed. If you fancy reverse engineering the Belgium API, you can take a look to my post https://medium.com/@andre.miras/reverse-engineering-sodexos-api-d13710b7bf0d

FilipDem commented 2 years ago

Thanks! I know how to do, but I hoped that I could escape it by using your solution :-). F

Op vr 22 okt. 2021 om 14:58 schreef Andre Miras @.***>:

Makes sense indeed. If you fancy reverse engineering the Belgium API, you can take a look to my post @.***/reverse-engineering-sodexos-api-d13710b7bf0d

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/AndreMiras/mysodexo/issues/3#issuecomment-949607487, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD3SGC6A56GAJNBDASZBK2LUIFNWTANCNFSM5GMNPUQQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.