question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Seems like my Kia Connect (Not KIA Uvo) is working slightly different to get a “ControlToken”. It gets a token by sending vehicle ID and PIN:

PUT https://prd.eu-ccapi.kia.com:8080/api/v1/user/pin HTTP/1.1
Host: prd.eu-ccapi.kia.com:8080
Authorization: Bearer ey...Wg
Accept: */*
ccsp-service-id: fdc85c00-0a2f-4c64-bcb4-2cfb1500730a
Accept-Language: en-GB;q=1.0
ccsp-application-id: a2...74
Accept-Encoding: br;q=1.0, gzip;q=0.9, deflate;q=0.8
Stamp: oY..cA=
offset: 1
Content-Length: 64
User-Agent: EU_BlueLink/2.1.3 (com.kia.connect.eu; build:269; iOS 15.3.0) Alamofire/5.4.3
Connection: keep-alive
Content-Type: application/json; charset=UTF-8
ccsp-device-id: 35..0d
Cookie: TS012...dd=01...99

{"deviceId":"a0-VIN-10","pin":"9999"}

And I am getting a control token back:

HTTP/1.1 200 OK
Ccsp-Request-Id: fe6b64fd-9604-4a32-9286-d121326cd7f9
Ccsp-Span-Id: 5
Content-Length: 705
Content-Security-Policy: script-src https://www.google.com/recaptcha/ https://www.gstatic.com/recaptcha/; style-src 'unsafe-inline'; frame-src https://www.google.com/recaptcha/
Content-Type: application/json
Date: Mon, 07 Feb 2022 09:56:30 GMT
Vary: Origin
X-Content-Type-Options: nosniff
X-Frame-Option: SAMEORIGIN
X-Ratelimit-Limit: 0
X-Ratelimit-Remaining: 0
X-Ratelimit-Reset: 0
X-Xss-Protection: 1; mode=block
Set-Cookie: TS012b00dd=01cb...99; Path=/; Domain=.prd.eu-ccapi.kia.com

{"controlToken":"ey.....sQ","expiresTime":600}

The control token is used as a Bearer token to all following requests. So not a full logon, but it is just using car ID and a 4 digit PIN code to get a control token. PIN is setup in app, but most users enable biometric logon (face/finger ID)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
povlhpcommented, Feb 7, 2022

ANd a V2 call for getting status:

GET https://prd.eu-ccapi.kia.com:8080/api/v2/spa/vehicles/a0...10/status HTTP/1.1
Host: prd.eu-ccapi.kia.com:8080
Accept: */*
Authorization: Bearer ey...Tg
ccsp-service-id: fdc85c00-0a2f-4c64-bcb4-2cfb1500730a
Accept-Language: en-GB;q=1.0
ccsp-application-id: a2b8469b-30a3-4361-8e13-6fceea8fbe74
Accept-Encoding: br;q=1.0, gzip;q=0.9, deflate;q=0.8
Stamp: oYa3/zyroR0vT6ZgagTzPJcFq9FRkgRPjU5ih3eFC/Og5gc/7ggPhHnIRMXF0MU=
offset: 1
User-Agent: EU_BlueLink/2.1.3 (com.kia.connect.eu; build:269; iOS 15.3.0) Alamofire/5.4.3
If-None-Match: W/"b62-jJZ75E3QDC8rwxuyfpktw+8KW8k"
Connection: keep-alive
Content-Type: application/json; charset=UTF-8
ccsp-device-id: 35...0d
Cookie: TS012b00dd=01..46

Response - the b62 before the json is there:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Mon, 07 Feb 2022 11:31:00 GMT
Etag: W/"b62-MNHjVWauU5aH7GA7IlX6cZBh9fQ"
X-Ratelimit-Limit: 100
X-Ratelimit-Remaining: 93
X-Ratelimit-Reset: 1644233498
Set-Cookie: TS012b00dd=01cba...46; Path=/; Domain=.prd.eu-ccapi.kia.com
Transfer-Encoding: chunked

b62
{"retCode":"S","resCode":"0000","resMsg":{"airCtrlOn":false,"engine":false,"doorLock":true,"doorOpen":{"frontLeft":0,"frontRight":0,"backLeft":0,"backRight":0},"trunkOpen":false,"airTemp":{"value":"02H","unit":0,"hvacTempType":1},"defrost":false,"acc":false,"evStatus":{"batteryCharge":false,"batteryStatus":81,"batteryPlugin":0,"remainTime2":{"etc1":{"value":38,"unit":1},"etc2":{"value":400,"unit":1},"etc3":{"value":115,"unit":1},"atc":{"value":61,"unit":1}},"drvDistance":[{"rangeByFuel":{"evModeRange":{"value":368,"unit":1},"totalAvailableRange":{"value":368,"unit":1}},"type":2}],"reservChargeInfos":{"reservChargeInfo":{"reservChargeInfoDetail":{"reservInfo":{"day":[9],"time":{"time":"1200","timeSection":0}},"reservChargeSet":false,"reservFatcSet":{"defrost":false,"airTemp":{"value":"00H","unit":0,"hvacTempType":1},"airCtrl":0,"heating1":0}}},"offpeakPowerInfo":{"offPeakPowerTime1":{"starttime":{"time":"1200","timeSection":0},"endtime":{"time":"1200","timeSection":0}},"offPeakPowerFlag":0},"reserveChargeInfo2":{"reservChargeInfoDetail":{"reservInfo":{"day":[9],"time":{"time":"1200","timeSection":0}},"reservChargeSet":false,"reservFatcSet":{"defrost":false,"airTemp":{"value":"00H","unit":0,"hvacTempType":1},"airCtrl":0,"heating1":0}}},"reservFlag":0,"ect":{"start":{"day":0,"time":{"time":"0000","timeSection":0}},"end":{"day":0,"time":{"time":"0000","timeSection":0}}},"targetSOClist":[{"targetSOClevel":100,"dte":{"rangeByFuel":{"evModeRange":{"value":464,"unit":1},"totalAvailableRange":{"value":464,"unit":1}},"type":2},"plugType":0},{"targetSOClevel":100,"dte":{"rangeByFuel":{"evModeRange":{"value":464,"unit":1},"totalAvailableRange":{"value":464,"unit":1}},"type":2},"plugType":1}]},"chargePortDoorOpenStatus":2,"batteryPreconditioning":false},"ign3":false,"hoodOpen":false,"transCond":false,"steerWheelHeat":0,"sideBackWindowHeat":0,"tirePressureLamp":{"tirePressureLampAll":0,"tirePressureLampFL":0,"tirePressureLampFR":0,"tirePressureLampRL":0,"tirePressureLampRR":0},"battery":{"batState":1,"sjbDeliveryMode":0,"batSignalReferenceValue":{"batWarning":0},"powerAutoCutMode":2},"lampWireStatus":{"stopLamp":{"stopLampStatus":false,"leftLamp":false,"rightLamp":false},"headLamp":{"headLampStatus":false,"leftLowLamp":false,"rightLowLamp":false,"leftHighLamp":false,"rightHighLamp":false,"leftBifuncLamp":false,"rightBifuncLamp":false},"turnSignalLamp":{"turnSignalLampStatus":false,"leftFrontLamp":false,"rightFrontLamp":false,"leftRearLamp":false,"rightRearLamp":false}},"windowOpen":{"frontLeft":0,"frontRight":0,"backLeft":0,"backRight":0},"smartKeyBatteryWarning":false,"washerFluidStatus":false,"breakOilStatus":false,"sleepModeCheck":false,"time":"20220207123100","remoteWaitingTimeAlert":{"remoteControlAvailable":1,"remoteControlWaitingTime":168,"elapsedTime":"03:42:24"},"systemCutOffAlert":0,"tailLampStatus":0,"hazardStatus":0},"msgId":"26...e9"}
0

1reaction
povlhpcommented, Feb 7, 2022

And V2 close door:

POST https://prd.eu-ccapi.kia.com:8080/api/v2/spa/vehicles/a0...910/control/door HTTP/1.1
Host: prd.eu-ccapi.kia.com:8080
Authorization: Bearer ey..._zLTg
Accept: */*
ccsp-service-id: fdc85c00-0a2f-4c64-bcb4-2cfb1500730a
Accept-Language: en-GB;q=1.0
ccsp-application-id: a2b8469b-30a3-4361-8e13-6fceea8fbe74
Accept-Encoding: br;q=1.0, gzip;q=0.9, deflate;q=0.8
Stamp: oYa3/zyroR0vT6ZgagTzPJcFq9FRkgRPjU5ih3eFC/Og5gc/7ggPhHnIRMXB1sU=
offset: 1
Content-Length: 68
User-Agent: EU_BlueLink/2.1.3 (com.kia.connect.eu; build:269; iOS 15.3.0) Alamofire/5.4.3
If-None-Match: W/"4f-jLKY2U8+Z5dYtsGROOjYiE3irY0"
Connection: keep-alive
Content-Type: application/json; charset=UTF-8
ccsp-device-id: 35...0d
Cookie: TS012b00dd=01...1b

{"action":"close","deviceId":"35...0d"}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Add or change your authentication method - Login.gov
On your Login.gov account page, review the “Your authentication methods” menu options on the left side of the page. Select a new device...
Read more >
Google's new login method replaces passwords with your phone
Google is testing out a new feature that could do away with passwords entirely, letting users sign in using their own smartphones.
Read more >
RIP passwords: new web standard designed to replace login ...
The Web Authentication (WebAuthn) standard is designed to replace the password with biometrics and devices that users already own, such as a ...
Read more >
Authentication Tools for Secure Sign In - Google Safety Center
Learn how our authentication tools and services help you sign in securely. ... accessed from a new device, we make it quick and...
Read more >
Set up Security info from a sign-in page - Microsoft Support
Password reset authentication only. You'll need to choose a different method for two-factor verification. Sign in to your work or school account.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found