ad-ha / mg-saic-ha

MG SAIC Custom Integration for Home Assistant
MIT License
11 stars 0 forks source link

Login failed #3

Closed polish83 closed 3 months ago

polish83 commented 3 months ago

Hi

I'm trying to use this integration and it is not possible. When I try to log in I get error “Authentication error, please verify your credentials”.

I've tried logging in with email and phone number. The credentials are correct, if I close the session on the mobile I can login without problem with those same credential. I am using the europe location, I am in Spain.

ad-ha commented 3 months ago

Hi @polish83 ,

I just tried to remove my integration and add it again and had no issues doing the login.

I'm also in Spain and using the EU server, and it all seems to work fine. Are you able to share the debug log from your Home Assistant integration?

My suggestion is that you add the following to configuration.yaml:

logger:
  default: warning
  logs:
    custom_components.mg_saic: debug

After check the logs after trying to add the integration and let me know, please.

polish83 commented 3 months ago
2024-08-14 21:02:28.834 ERROR (MainThread) [saic_ismart_client_ng.api.base] API call return code is not acceptable: 15018: {"code":15018,"message":"Incorrect password. You may have another 4 attempts of the day, please try again."}. Headers: Headers({'date': 'Wed, 14 Aug 2024 19:02:28 GMT', 'content-type': 'application/x-www-form-urlencoded', 'content-length': '108', 'connection': 'keep-alive', 'x-content-type-options': 'nosniff', 'x-xss-protection': '1; mode=block', 'cache-control': 'no-cache, no-store, max-age=0, must-revalidate', 'pragma': 'no-cache', 'expires': '0', 'x-frame-options': 'DENY', 'app-content-encrypted': '1', 'original-content-type': 'application/x-www-form-urlencoded', 'app-send-date': '1723662148813', 'app-verification-string': '2086fac90b5201d36e6386431f97e7938202928bffa3ec06062cb85fd69fee53'})
2024-08-14 21:02:28.834 ERROR (MainThread) [custom_components.mg_saic] Error fetching vehicle data: return code: 15018, message: Incorrect password. You may have another 4 attempts of the day, please try again.
2024-08-14 21:02:28.835 ERROR (MainThread) [custom_components.mg_saic] Failed to authenticate or fetch vehicle data: return code: 15018, message: Incorrect password. You may have another 4 attempts of the day, please try again.

I'm sure that password it's correct, I put the same password that mobile APP.

ad-ha commented 3 months ago

Hi @polish83 ,

That is quite strange, but if thar error message comes directly from the MG web, not from the integration.

As I understand, you get the same message when trying both login types, with phone and email, right? Probably there's an issue on MG"s end.

Thinking out loud. Can you try to change the login password on the app (for testing I would recommend you do not use symbols, only numbers and letters), and try again?

I noticed that the MG API sometimes does not respond to queries from the integration, but I did not find that behavior while testing with the correct password.

Let me know.

Saludos

polish83 commented 3 months ago

Hi Alvaro,

This is a problem with passwords containing special characters, with alphanumeric passwords only it works fine. If you want you can close the issue.

Thanks Marcos

ad-ha commented 3 months ago

Hi @polish83 ,

That's what I thought. Thank you for checking and letting me know.

I hope and assume that it all works well now.

Let me know if there's any other issue.

Cheers

ad-ha commented 3 months ago

Problem solved.

Will add a note on alphanumeric passwords on future releases.