Skip to content
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

setup wizard error #535

Open
vtolstov opened this issue Aug 14, 2024 · 9 comments
Open

setup wizard error #535

vtolstov opened this issue Aug 14, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@vtolstov
Copy link

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 vtolstov added the bug Something isn't working label Aug 14, 2024
@vtolstov
Copy link
Author

vtolstov commented Aug 14, 2024

why i can't use my own client_id ?

@sam01792
Copy link

why i can't use my own client_id ?

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

@astrandb
Copy link
Owner

astrandb commented Sep 2, 2024

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: #247

@csentis
Copy link

csentis commented Nov 24, 2024

@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
Copy link

csentis commented Nov 24, 2024

@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
Copy link
Owner

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

@KB1RMA
Copy link

KB1RMA commented Nov 27, 2024

I've tried this twice now with a variety of methods. Copy and paste from the web, visually entering. And I've reapplied for credentials twice but I'm still getting a

invalid_client: Client credentials are not valid, clientId: client-id-here

When trying to use and authorize them here: https://www.miele.com/developer/swagger-ui/

I've verified there are no strange characters being picked up in either... I wonder if something is up with the Miele service minting credentials?

@astrandb
Copy link
Owner

We have seen that password with special characters can cause failure and give unexpected error messages.

@KB1RMA
Copy link

KB1RMA commented Dec 3, 2024

To provide an update on my issues with credentials - I just came back a week later and retried entering the same client_id and client_secret and authorizing with miele.com/developer/swagger-ui and the same credentials worked successfully.

Then, after confirming the credentials worked with Swagger UI, I cleared out my credentials from HASS, re-ran the configuration wizard and was able to successfully authenticate with HASS.

I'm pretty confident my issue was not mistaken characters (such as a newline) as all my attempts were copying credentials from my secrets.yaml file into the website and HASS UI and that file has not changed. Which leaves me to suspect there is/was a delay on Miele's side generating the credentials and them being valid against the API. This is obviously just a hypothesis since almost a full week has gone by - but it's something for anyone else to try should they run into this issue and have ruled out the extraneous character problem. Just try again in a couple days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants