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

Error Connecting #9

Closed
boc-tothefuture opened this issue Mar 13, 2020 · 10 comments
Closed

Error Connecting #9

boc-tothefuture opened this issue Mar 13, 2020 · 10 comments

Comments

@boc-tothefuture
Copy link

Everytime I attempt to use the script, I receive the following error.

Oauth authentication did not return array...
Failed to create config! Did you type the correct credentials?

I seem to be able to enable to get it to work using https://oauthdebugger.com/

Are there any suggestions for debugging a failing oauth with this script?

@oklona
Copy link
Owner

oklona commented Apr 2, 2020

Hi! Sorry I'm late to reply. I was under the impression I was automatically watching the thread, since I "own" the code. Normally that error means your credentials no longer work, and you have to recreate the config file.

Was this with the newest version of the script?

@boc-tothefuture
Copy link
Author

This is the newest version of the script. I am getting this error when I am creating the config file. They do work if I manually go through the oauth process.

@oklona
Copy link
Owner

oklona commented Apr 6, 2020

So, you run Oauth and get a bearer-token, which you then feed into the config file, and then it works?

Interesting. In order to use Miele's Oauth, we perform a post of email-address, password, client ID and country-ID. In a public script, I wouldn't insert anything that would reveal passwords and such, but if write the following to line 173 in the script:

print "Postdata: " . $postdata . PHP_EOL;

You should at least be able to see what data we are trying to send to Miele. My only guess would be if your password contains characters that PHP is not happy with, but as we URL-encode the data, i don't really see what characters that would be.

@oklona oklona mentioned this issue Apr 14, 2020
@AleksCee
Copy link

I have a same error on first call. The Page in the Response say, that I have to accept the access. After I do the same Request with the swagger-API from the miele site, I get a Website to login and accept the access. After this, the Script works fine also with the same client_id.

@oklona
Copy link
Owner

oklona commented Oct 27, 2020

I have a same error on first call. The Page in the Response say, that I have to accept the access. After I do the same Request with the swagger-API from the miele site, I get a Website to login and accept the access. After this, the Script works fine also with the same client_id.

Ok, interesting. Since I have already accepted this for my account, and my ClientID, I don't get that any more. This explains a lot! The best thing would naturally be to be able to present that page, but it is kind of hard to do in a script...

@AleksCee
Copy link

Yes, I think so too. It's very hard. Perhaps the manual way is the best option and explain it in the readme? It's only a one-taske-at-all-action - so the overhead for the script is to much, I think.

@oklona
Copy link
Owner

oklona commented Oct 27, 2020

Yeah, agreed. -But still, the "refresh_token" process of Oauth2 doesn't seem to be implemented with Miele, so we still need to reauthenticate every three months or so...

@oklona
Copy link
Owner

oklona commented Nov 3, 2020

After asking on a different forum about the refresh_token process, I was told it is in a different section of the documentation to where I was looking for it. -So it is there, it is clearly documented, and can be added. -So, completely my bad. I will start looking into refreshing tokens now.

@oklona
Copy link
Owner

oklona commented Mar 26, 2021

I hope to be able to look into token refreshing and such next week, in order to create a good Easter release :-)

@oklona
Copy link
Owner

oklona commented May 6, 2021

I have now added support for refreshing the access token. Therefore, I believe this has been resolved. I will close this issue, and I guess it can be reopened if you are still experiencing errors.

@oklona oklona closed this as completed May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants