astrandb / miele

A modern integration for Miele devices in Home Assistant
MIT License
207 stars 31 forks source link

setup wizard error #535

Open vtolstov opened 3 months ago

vtolstov commented 3 months ago

The problem

https://api.mcs3.miele.com/thirdparty/login?response_type=code&client_id=2b999780-2279-4d9a-baa2-d872fbbea3ec&redirect_uri=https://my.home-assistant.io/redirect/oauth&state=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmbG93X2lkIjoiMDFKNTlEWjhXV1c5UzNQME1BQ1BWQkpSQUEiLCJyZWRpcmVjdF91cmkiOiJodHRwczovL215LmhvbWUtYXNzaXN0YW50LmlvL3JlZGlyZWN0L29hdXRoIn0.M5Ji_rGiZGIw2o9nRHnPralz8r2YBo__P5Za-6fJNIs&vg=sv_SE

says Authentication failed!

Please check your login details.

invalid_client: Client credentials are not valid, clientId: 2b999780-2279-4d9a-baa2-d872fbbea3ec

Version of miele integration having the issue?

2024.8.1

Version of Home Assistant Core having the issue?

2024.8.0

Anything in the logs that might be useful for us?

No response

Additional information

No response

vtolstov commented 3 months ago

why i can't use my own client_id ?

sam01792 commented 2 months ago

why i can't use my own client_id ?

I’m having the same issue. Did you work out what to do?

astrandb commented 2 months ago

You can verify that your credentials work at https://www.miele.com/developer/swagger-ui/ If needed you can reset your credentials in HA by following these intructions: https://github.com/astrandb/miele/discussions/247

csentis commented 1 day ago

@astrandb I have the same issue. Have you noticed a typical delay on the Miele systems' side?

I registered as a developer, stating your integration's name as "Name," and providing my email address. Five minutes later, Miele sent me an activation mail. After clicking on the link, I was taken to a page I archived as a PDF, showing the OAuth credentials.

I entered the same in your integration, providing as name just "Miele API", so NOT the name I gave when initially applying for the developer access - was that a mistake?

Miele tells me my credentials are wrong. Verification of my credentials using the Swagger UI failed as well. The credentials are those Miele provided me with (I compared them against the archived PDF).

Could there be a delay in being able to use the API or a specific detail I may have missed?

csentis commented 1 day ago

@vtolstov @sam01792 @astrandb Here is how to fix this:

I first reapplied at developer.miele.com for new credentials. Turns out that this was unnecessary: they provided me with the same credentials. I then noticed a line break in the Client Id.

  1. Head over to: https://api.mcs3.miele.com/thirdparty/login/ (might need a fresh cache) and enter dev credentials, but his time make sure that you do not copy & paste your Client Id but type it in (at least the part around the line break)
  2. tick the two boxes below to set authorizations and
  3. get taken to a form that allows you to enter your customer information + country.
  4. After submitting, dev credentials should be confirmed to be linked to your customer account.
  5. Add the Miele integration in HA - you should be taken to the (customer) login form,
  6. Accept to "Link account to Home Assistant",
  7. Add areas for your Miele devices...

... and you should be all set.

astrandb commented 1 day ago

@csentis Good catch! Another common error when copy/paste is leading or trailing spaces.