-
Notifications
You must be signed in to change notification settings - Fork 76
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
Genesis EU / Login failed #514
Comments
Will need more details. |
This seems to be an issue with the /signin invocation, which causes the /integrationinfo to fail. Also, the URL for the oidc auth endpoint should not include the /auth/ prefix. Debug LogsThe _get_authorization_code_with_redirect_url fails: 024-05-01 12:14:09.349 DEBUG (SyncWorker_12) [hyundai_kia_connect_api.KiaUvoApiEU] hyundai_kia_connect_api - Get Device ID request: https://prd-eu-ccapi.genesis.com:443/api/v1/spa/notifications/register {'ccsp-service-id': '3020afa2-30ff-412a-aa51-d28fbe901e10', 'ccsp-application-id': 'f11f2b86-e0e7-4851-90df-5600b01d8b70', 'Stamp': 'ImpZIJ2NNURLI0cNUotk8b8G05h70TJzbvXLirZ/QKkhptv+KoiKqNhaiBJUypM=', 'Content-Type': 'application/json;charset=UTF-8', 'Host': 'prd-eu-ccapi.genesis.com:443', 'Connection': 'Keep-Alive', 'Accept-Encoding': 'gzip', 'User-Agent': 'okhttp/3.12.0'} {'pushRegId': 'XXXXXX', 'pushType': 'GCM', 'uuid': 'XXXXX'}
2024-05-01 12:14:09.616 DEBUG (SyncWorker_12) [hyundai_kia_connect_api.KiaUvoApiEU] hyundai_kia_connect_api - Get Device ID response: {'retCode': 'S', 'resCode': '0000', 'resMsg': {'deviceId': 'XXXXX'}, 'msgId': 'XXXXXX'}
2024-05-01 12:14:09.617 DEBUG (SyncWorker_12) [hyundai_kia_connect_api.KiaUvoApiEU] hyundai_kia_connect_api - Get cookies request: https://prd-eu-ccapi.genesis.com:443/api/v1/user/oauth2/authorize?response_type=code&state=test&client_id=3020afa2-30ff-412a-aa51-d28fbe901e10&redirect_uri=https://prd-eu-ccapi.genesis.com:443/api/v1/user/oauth2/redirect&lang=en
2024-05-01 12:14:09.805 DEBUG (SyncWorker_12) [hyundai_kia_connect_api.KiaUvoApiEU] hyundai_kia_connect_api - Get cookies response: {'account': 'XXXXX', 'TS01f622c7': 'XXXXX'}
2024-05-01 12:14:10.175 DEBUG (SyncWorker_12) [hyundai_kia_connect_api.KiaUvoApiEU] hyundai_kia_connect_api - Sign In Response: {'errId': 'XXXXX', 'errCode': '4010', 'errMsg': 'Require authentication'}
2024-05-01 12:14:10.176 DEBUG (SyncWorker_12) [hyundai_kia_connect_api.KiaUvoApiEU] hyundai_kia_connect_api - get_authorization_code_with_redirect_url failed The fallback _get_authorization_code_with_form 2024-05-01 12:14:10.358 DEBUG (SyncWorker_12) [hyundai_kia_connect_api.KiaUvoApiEU] hyundai_kia_connect_api - IntegrationInfo Response: {'userId': '', 'serviceId': '', 'serviceName': ''} Finally, the login form request fails (as the URL is incorrect and we get a 404): 2024-05-01 12:14:10.537 DEBUG (SyncWorker_12) [hyundai_kia_connect_api.KiaUvoApiEU] hyundai_kia_connect_api - LoginForm https://accounts-eu.genesis.com/auth/realms/eugenesisidm/protocol/openid-connect/auth?client_id=3020afa2-30ff-412a-aa51-d28fbe901e10&scope=openid%20profile%20email%20phone&response_type=code&hkid_session_reset=true&redirect_uri=https://prd-eu-ccapi.genesis.com:443/api/v1/user/integration/redirect/login&ui_locales=en&state=: - Response: {"error":"HTTP 404 Not Found"} This ultimately ends up with the exception in 2024-05-01 12:14:10.542 ERROR (MainThread) [custom_components.kia_uvo.config_flow] Unexpected exception
Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 238, in login
authorization_code = self._get_authorization_code_with_redirect_url(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 1226, in _get_authorization_code_with_redirect_url
parsed_url = urlparse(response["redirectUrl"])
~~~~~~~~^^^^^^^^^^^^^^^
KeyError: 'redirectUrl'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/config/custom_components/kia_uvo/config_flow.py", line 159, in async_step_user
await validate_input(self.hass, user_input)
File "/config/custom_components/kia_uvo/config_flow.py", line 63, in validate_input
token: Token = await hass.async_add_executor_job(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 243, in login
authorization_code = self._get_authorization_code_with_form(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/hyundai_kia_connect_api/KiaUvoApiEU.py", line 1250, in _get_authorization_code_with_form
login_form_action_url = soup.find("form")["action"].replace("&", "&")
~~~~~~~~~~~~~~~~~^^^^^^^^^^
TypeError: 'NoneType' object is not subscriptable LoginForm URLThe login form URL used includes an
This should be: + "/realms/eugenesisidm/protocol/openid-connect/auth?client_id=" 404 Errorcurl -o /dev/null -s -w "\n%{http_code}\n" https://accounts-eu.genesis.com/auth/realms/eugenesisidm/protocol/openid-connect/auth
404 400 Error (I didn't submit client_id, etc)
|
Could you create a PR to solve it? |
I am working through it, but even with the updated url I am now getting a Bad Request on the login form. I believe the issue may be that the |
No. Reverse engineering the native app is the only way. |
any updates on this issue? This is also not working: {"errId":"fe69c315-9b0f-49d7-8c16-778b9b33ea87","errCode":"4002","errMsg":"Invalid parameters"} |
Ok I found one issue...the redirect_uri must be https://accounts-eu.genesis.com/realms/eugenesisidm/ga-api/redirect/api/v1/user/oauth2/redirect: this results in: after that, I also receive the parameters for this one: https://prd-eu-ccapi.genesis.com/api/v1/user/integrationinfo {"userId":"***","serviceId":"3020afa2-30ff-412a-aa51-d28fbe901e10","serviceName":"Genesis Connected Services"} |
I'm nearly there...Setting Language and Login works (Language of push requests were changed after that):
after that, this is also wrong:
should be:
hope this helps! |
Could you create a PR for this? |
Sorry, I'm not really a developer, I just tried to read your code because I'm interested in getting this API running. I've a Genesis car and also know how to use a proxy to be able to catch all the requests and responses from the Genesis iOS app. So if you need any info or testing of the Genesis app / API I'm here to help you. |
Login in Germany / EU with Genesis fails
The text was updated successfully, but these errors were encountered: