Hyundai-Kia-Connect / hyundai_kia_connect_api

This is a Kia UVO and Hyundai Bluelink written in python. It is primary consumed by home assistant. If you are looking for a home assistant Kia / Hyundai implementation please look here: https://github.com/Hyundai-Kia-Connect/kia_uvo. Much of this base code came from reading bluelinky and contributions to the kia_uvo home assistant project.
MIT License
120 stars 70 forks source link

Unable to login with KiaUvoAPIUSA.py #601

Open bashavolteras opened 1 month ago

bashavolteras commented 1 month ago

Description

Unable to login using US based credentials to a USA KIA based account/vehicle. Login attempt happening from UK, London. Curl request below (same request using KiaUvoAPIUSA.py login function)

curl -X POST "https://api.owners.kia.com/apigw/v1/prof/authUser" \
     -H "content-type: application/json;charset=UTF-8" \
     -H "accept: application/json, text/plain, */*" \
     -H "accept-encoding: gzip, deflate, br" \
     -H "accept-language: en-US,en;q=0.9" \
     -H "apptype: L" \
     -H "appversion: 4.10.0" \
     -H "clientid: MWAMOBILE" \
     -H "from: SPA" \
     -H "host: api.owners.kia.com" \
     -H "language: 0" \
     -H "offset: 0" \
     -H "ostype: Android" \
     -H "osversion: 11" \
     -H "secretkey: 98er-w34rf-ibf3-3f6h" \
     -H "to: APIGW" \
     -H "tokentype: G" \
     -H "user-agent: okhttp/3.12.1" \
     -H "date: Wed, 31 Jul 2024 11:47:02 GMT" \
     -H "deviceid: Z3aB4k9mC0z8Ew1x2Tt8Jf0G:WlU1UjZz6H9G7LJh0K6YsQ2UfzQoD5FaO4AkYPw" \
     -d '{
           "deviceKey": "",
           "deviceType": 2,
           "userCredential": {"userId": "kia@..", "password": "...."}
         }'

Output:

{"status":{"statusCode":1,"errorType":1,"errorCode":1001,"errorMessage":"Invalid Email or Password"}} 

What I Did

Please note if I use Kia Connect app on my iphone, and tracing the network requests, seems like the app uses the eu based url [prd.eu-ccapi.kia.com](http://prd.eu-ccapi.kia.com/) to login and list the available vehicles, even though the account itself is US based.

cdnninja commented 1 month ago

Did you try picking eu location just to see what happens?