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

Connection issue when password contains any special character #76

Open
hautfr opened this issue Oct 29, 2022 · 11 comments
Open

Connection issue when password contains any special character #76

hautfr opened this issue Oct 29, 2022 · 11 comments
Labels
bug Something isn't working

Comments

@hautfr
Copy link

hautfr commented Oct 29, 2022

I have an error while trying to connect, debug log below.
Would you please have any idea?
Many thanks.

2022-10-29 09:38:11,944 INFO Connexion to GRDF, try 1/14...
2022-10-29 09:38:11,967 DEBUG Starting new HTTPS connection (1): monespace.grdf.fr:443
2022-10-29 09:38:12,019 DEBUG https://monespace.grdf.fr:443 "GET /client/particulier/accueil HTTP/1.1" 302 138
2022-10-29 09:38:12,022 DEBUG Starting new HTTPS connection (1): sofa-connexion.grdf.fr:443
2022-10-29 09:38:12,069 DEBUG https://sofa-connexion.grdf.fr:443 "GET /openam/oauth2/externeGrdf/authorize?response_type=code&scope=openid+profile+email+infotravaux+/v1/accreditation+/v1/accreditations+/digiconso/v1+/digiconso/v1/consommations+new_meg+/Demande.read+/Demande.write+/digiraccob2c/v1&client_id=prod_espaceclient&state=%2Fclient%2Fparticulier%2Faccueil&redirect_uri=https://monespace.grdf.fr/_codexch&nonce=RSvM9B0xFLsQzthE_a4k8pocrCwzP2jfgcYpNnKJ1go&by_pass_okta=1&capp=meg HTTP/1.1" 302 0
2022-10-29 09:38:12,073 DEBUG Starting new HTTPS connection (1): login.monespace.grdf.fr:443
2022-10-29 09:38:12,119 DEBUG https://login.monespace.grdf.fr:443 "GET /mire/connexion?goto=https%3A%2F%2Fsofa-connexion.grdf.fr%3A443%2Fopenam%2Foauth2%2FexterneGrdf%2Fauthorize%3Fresponse_type%3Dcode%26scope%3Dopenid%2520profile%2520email%2520infotravaux%2520%252Fv1%252Faccreditation%2520%252Fv1%252Faccreditations%2520%252Fdigiconso%252Fv1%2520%252Fdigiconso%252Fv1%252Fconsommations%2520new_meg%2520%252FDemande.read%2520%252FDemande.write%2520%252Fdigiraccob2c%252Fv1%26client_id%3Dprod_espaceclient%26state%3D%252Fclient%252Fparticulier%252Faccueil%26redirect_uri%3Dhttps%253A%252F%252Fmonespace.grdf.fr%252F_codexch%26nonce%3DRSvM9B0xFLsQzthE_a4k8pocrCwzP2jfgcYpNnKJ1go%26by_pass_okta%3D1%26capp%3Dmeg&realm=/externeGrdf&capp=meg HTTP/1.1" 200 836
2022-10-29 09:38:12,120 DEBUG Cookies ok.
2022-10-29 09:38:12,120 DEBUG auth_nonce: 2bc3b7fc88c3abab871606c32f34dccd
2022-10-29 09:38:12,120 DEBUG Logging ...
2022-10-29 09:38:12,120 DEBUG Logging payload : {'email': 'xxx@gmail.com', 'password': 'xxxxxxx', 'capp': 'meg', 'goto': 'https://sofa-connexion.grdf.fr:443/openam/oauth2/externeGrdf/authorize'}
2022-10-29 09:38:12,199 DEBUG https://login.monespace.grdf.fr:443 "POST /sofit-account-api/api/v1/auth HTTP/1.1" 200 None
2022-10-29 09:38:12,200 DEBUG Logging returned : {"state":"REINPUT","error":"AUTH_FAIL","actualLockoutDuration":0,"message":"password.incorrect","displayCaptcha":true,"surname":"xxxxx","name":"xxx","email":"xxxx@gmail.com"}
2022-10-29 09:38:12,200 INFO <Response [200]>
2022-10-29 09:38:12,200 INFO <RequestsCookieJar[<Cookie XSRF-TOKEN=6828ad28-ddbb-4674-b539-9d8d96cda815 for .grdf.fr/>, , <Cookie JSESSIONID=85EED89D7557EA998DDB28FB06D72056 for login.monespace.grdf.fr/sofit-account-api>, <Cookie BIGipServerEXT_PRODPL-EXT_PROD-VS_P1_SIG-S_EPS_HTTPS_Internet=rd6o00000000000000000000ffff0a28a21ao443 for monespace.grdf.fr/>, , ]>
2022-10-29 09:38:12,200 INFO Login unsuccessful. Invalid returned information: {"state":"REINPUT","error":"AUTH_FAIL","actualLockoutDuration":0,"message":"password.incorrect","displayCaptcha":true,"surname":"xxxx","name":"xxxxxx","email":"xxxxxx@gmail.com"}
2022-10-29 09:38:12,200 INFO Unable to login to GRDF website
2022-10-29 09:38:12,200 INFO Wait 20 seconds (0 min) before next try

@yukulehe
Copy link
Owner

Hello. Log says password incorrect.

@hautfr
Copy link
Author

hautfr commented Oct 30, 2022

Thank you, but not anymore. I tried manually to access the website and all works. Maybe an issue with the Captcha?
Says: LOGIN_INVALID_ATTEMPTS

2022-10-30 03:20:20,134 INFO Unable to login to GRDF website
2022-10-30 03:20:20,134 INFO Wait 19 minutes before next try
2022-10-30 03:38:58,228 INFO Connexion to GRDF, try 6/14...
2022-10-30 03:38:58,231 DEBUG Starting new HTTPS connection (1): monespace.grdf.fr:443
2022-10-30 03:38:58,286 DEBUG https://monespace.grdf.fr:443 "GET /client/particulier/accueil HTTP/1.1" 302 138
2022-10-30 03:38:58,291 DEBUG Starting new HTTPS connection (1): sofa-connexion.grdf.fr:443
2022-10-30 03:38:58,347 DEBUG https://sofa-connexion.grdf.fr:443 "GET /openam/oauth2/externeGrdf/authorize?response_type=code&scope=openid+profile+email+infotravaux+/v1/accreditation+/v1/accreditations+/digiconso/v1+/digiconso/v1/consommations+new_meg+/Demande.read+/Demande.write+/digiraccob2c/v1&client_id=prod_espaceclient&state=%2Fclient%2Fparticulier%2Faccueil&redirect_uri=https://monespace.grdf.fr/_codexch&nonce=JU-VMc4mHEwOrgPjoR1VPaf9ifoi-OvgEnbXe_e_6cE&by_pass_okta=1&capp=meg HTTP/1.1" 302 0
2022-10-30 03:38:58,352 DEBUG Starting new HTTPS connection (1): login.monespace.grdf.fr:443
2022-10-30 03:38:58,558 DEBUG https://login.monespace.grdf.fr:443 "GET /mire/connexion?goto=https%3A%2F%2Fsofa-connexion.grdf.fr%3A443%2Fopenam%2Foauth2%2FexterneGrdf%2Fauthorize%3Fresponse_type%3Dcode%26scope%3Dopenid%2520profile%2520email%2520infotravaux%2520%252Fv1%252Faccreditation%2520%252Fv1%252Faccreditations%2520%252Fdigiconso%252Fv1%2520%252Fdigiconso%252Fv1%252Fconsommations%2520new_meg%2520%252FDemande.read%2520%252FDemande.write%2520%252Fdigiraccob2c%252Fv1%26client_id%3Dprod_espaceclient%26state%3D%252Fclient%252Fparticulier%252Faccueil%26redirect_uri%3Dhttps%253A%252F%252Fmonespace.grdf.fr%252F_codexch%26nonce%3DJU-VMc4mHEwOrgPjoR1VPaf9ifoi-OvgEnbXe_e_6cE%26by_pass_okta%3D1%26capp%3Dmeg&realm=/externeGrdf&capp=meg HTTP/1.1" 200 836
2022-10-30 03:38:58,559 DEBUG Cookies ok.
2022-10-30 03:38:58,559 DEBUG auth_nonce: 20249b1d2ba490d6d8d90b0919e23b49
2022-10-30 03:38:58,559 DEBUG Logging ...
2022-10-30 03:38:58,559 DEBUG Logging payload : {'email': 'xxxxxx@gmail.com', 'password': 'xxxxxxxxx', 'capp': 'meg', 'goto': 'https://sofa-connexion.grdf.fr:443/openam/oauth2/externeGrdf/authorize'}
2022-10-30 03:38:58,604 DEBUG https://login.monespace.grdf.fr:443 "POST /sofit-account-api/api/v1/auth HTTP/1.1" 200 None
2022-10-30 03:38:58,606 DEBUG Logging returned : {"state":"REINPUT","error":"LOGIN_INVALID_ATTEMPTS","actualLockoutDuration":0,"message":"login.error.invalidattempts","displayCaptcha":true,"surname":"xxxxxx","name":"xxxxxx","email":"xxxxxxx@gmail.com"}
2022-10-30 03:38:58,606 INFO <Response [200]>
2022-10-30 03:38:58,606 INFO <RequestsCookieJar[<Cookie XSRF-TOKEN=568cc422-a643-48d9-a832-8e6154ddc498 for .grdf.fr/>, , <Cookie JSESSIONID=8A8DB8BDED7C1E1871597082B6BD634C for login.monespace.grdf.fr/sofit-account-api>, <Cookie BIGipServerEXT_PRODPL-EXT_PROD-VS_P1_SIG-S_EPS_HTTPS_Internet=rd6o00000000000000000000ffff0a28a21bo443 for monespace.grdf.fr/>, , ]>
2022-10-30 03:38:58,606 INFO Login unsuccessful. Invalid returned information: {"state":"REINPUT","error":"LOGIN_INVALID_ATTEMPTS","actualLockoutDuration":0,"message":"login.error.invalidattempts","displayCaptcha":true,"surname":"xxxxxxx","name":"xxxxxxx","email":"xxxxxxx@gmail.com"}
2022-10-30 03:38:58,606 INFO Unable to login to GRDF website
2022-10-30 03:38:58,607 INFO Wait 29 minutes before next try

@yukulehe
Copy link
Owner

Check that your username and password are correctly set in environment variables.
Example :
image

It could be an extra character (ie: a quote) in the string of your username and password.

@yukulehe
Copy link
Owner

yukulehe commented Nov 2, 2022

@hautfr Any news ?

@yukulehe yukulehe added the help wanted Extra attention is needed label Nov 2, 2022
@hautfr
Copy link
Author

hautfr commented Nov 2, 2022

Hi yukulehe,
Unfortunately I can't get this working. I attach the full log in case you see something wrong, apologies if it is long. It works well with the username and password to access manually the GRDF website.
Many thanks for any help / support you may provide.

Home Assistant 2022.10.5 Supervisor 2022.10.0 Operating System 9.3 Interface utilisateur : 20221010.0 - latest

/etc/cont-init.d/90-config_yaml.sh: executing
Using config file found in /config/gazpar2mqtt/config.yaml
Config file is a valid yaml
[21:10:29] INFO: Starting the app with the variables in /config/gazpar2mqtt/config.yaml
GRDF_USERNAME=xxx@gmail.com
GRDF_PASSWORD=xxxxxxxxxxxxxx
MQTT_HOST=core-mosquitto
MQTT_USERNAME=XXXX
MQTT_PASSWORD=xxxxxxxx
DEBUG=true
/etc/cont-init.d/99-run.sh: executing

Starting the app

2022-11-02 21:10:31,823 INFO -----------------------------------------------------------
2022-11-02 21:10:31,823 INFO # Welcome to gazpar2mqtt #
2022-11-02 21:10:31,823 INFO -----------------------------------------------------------
2022-11-02 21:10:31,823 INFO Program version : 0.8.2
2022-11-02 21:10:31,824 INFO Database version : 0.8.0
2022-11-02 21:10:31,824 INFO Influxdb version : 0.8.0
2022-11-02 21:10:31,824 INFO Please note that the the tool is still under development, various functions may disappear or be modified.
2022-11-02 21:10:31,825 DEBUG If you can read this line, you are in DEBUG mode.
2022-11-02 21:10:31,825 INFO -----------------------------------------------------------
2022-11-02 21:10:31,825 INFO # Program parameters #
2022-11-02 21:10:31,825 INFO -----------------------------------------------------------
2022-11-02 21:10:31,825 INFO GRDF config : username = @., password = ******
2022-11-02 21:10:31,826 DEBUG GRDF config : username = xxxxxx@gmail.com, password = xxxxxxxxxx
2022-11-02 21:10:31,826 INFO MQTT broker config : host = core-mosquitto, port = 1883, clientId = gazpar2mqtt, qos = 1, topic = gazpar, retain = False, ssl = False
2022-11-02 21:10:31,826 INFO Standlone mode : Enable = True
2022-11-02 21:10:31,826 INFO Home Assistant discovery : Enable = False
2022-11-02 21:10:31,827 INFO Thresold options : Warning percentage = 80
2022-11-02 21:10:31,830 INFO Influxdb config : Enable = False
2022-11-02 21:10:31,831 INFO Price config : Default price = 0.07 €/kWh, default fix price = 0.9 €/day, path to file = /data
2022-11-02 21:10:31,831 INFO Database options : Force reinitialization = False, Path = /data
2022-11-02 21:10:31,831 INFO Debug mode : Enable = True
2022-11-02 21:10:31,831 INFO Check parameters...
2022-11-02 21:10:31,831 INFO Parameters are ok !
2022-11-02 21:10:31,832 INFO -----------------------------------------------------------
2022-11-02 21:10:31,832 INFO # Connexion to SQLite database #
2022-11-02 21:10:31,832 INFO -----------------------------------------------------------
2022-11-02 21:10:31,832 INFO Connexion to SQLite database...
2022-11-02 21:10:31,833 DEBUG Connexion to database
2022-11-02 21:10:31,903 INFO SQLite database connected !
2022-11-02 21:10:31,903 INFO Last execution date 2022-10-22 20:07:59.425491, program was in version 0.8.2.
2022-11-02 21:10:31,903 INFO Checking database version...
2022-11-02 21:10:31,903 INFO Your database is already up to date : version 0.8.0.
2022-11-02 21:10:31,904 INFO Retrieve database statistics...
2022-11-02 21:10:31,906 INFO 0 informatives measures stored
2022-11-02 21:10:31,906 INFO 0 PCE(s)
2022-11-02 21:10:31,906 INFO First measure : None
2022-11-02 21:10:31,906 INFO Last measure : None
2022-11-02 21:10:31,906 INFO -----------------------------------------------------------
2022-11-02 21:10:31,906 INFO # Connexion to Mqtt broker #
2022-11-02 21:10:31,906 INFO -----------------------------------------------------------
2022-11-02 21:10:31,906 INFO Connect to Mqtt broker...
2022-11-02 21:10:31,907 DEBUG Mqtt connect : activation of callbacks
2022-11-02 21:10:31,907 DEBUG Mqtt connect : connection to broker core-mosquitto:1883...
2022-11-02 21:10:31,909 DEBUG Wait for conexion callback
2022-11-02 21:10:33,911 DEBUG Mqtt on_connect callback : Connection Accepted.
2022-11-02 21:10:33,912 DEBUG Mqtt on_connect callback : connected
2022-11-02 21:10:35,914 INFO Mqtt broker connected !
2022-11-02 21:10:35,914 INFO -----------------------------------------------------------
2022-11-02 21:10:35,914 INFO # Get data from GRDF website #
2022-11-02 21:10:35,914 INFO -----------------------------------------------------------
2022-11-02 21:10:35,914 INFO Connexion to GRDF, try 1/14...
2022-11-02 21:10:35,918 DEBUG Starting new HTTPS connection (1): monespace.grdf.fr:443
2022-11-02 21:10:36,383 DEBUG https://monespace.grdf.fr:443 "GET /client/particulier/accueil HTTP/1.1" 302 138
2022-11-02 21:10:36,386 DEBUG Starting new HTTPS connection (1): sofa-connexion.grdf.fr:443
2022-11-02 21:10:36,865 DEBUG https://sofa-connexion.grdf.fr:443 "GET /openam/oauth2/externeGrdf/authorize?response_type=code&scope=openid+profile+email+infotravaux+/v1/accreditation+/v1/accreditations+/digiconso/v1+/digiconso/v1/consommations+new_meg+/Demande.read+/Demande.write+/digiraccob2c/v1&client_id=prod_espaceclient&state=%2Fclient%2Fparticulier%2Faccueil&redirect_uri=https://monespace.grdf.fr/_codexch&nonce=lWBWS5HMVMXc95LVSReW_QycI6GJaV33wO3WlNKz81s&by_pass_okta=1&capp=meg HTTP/1.1" 302 0
2022-11-02 21:10:36,870 DEBUG Starting new HTTPS connection (1): login.monespace.grdf.fr:443
2022-11-02 21:10:37,274 DEBUG https://login.monespace.grdf.fr:443 "GET /mire/connexion?goto=https%3A%2F%2Fsofa-connexion.grdf.fr%3A443%2Fopenam%2Foauth2%2FexterneGrdf%2Fauthorize%3Fresponse_type%3Dcode%26scope%3Dopenid%2520profile%2520email%2520infotravaux%2520%252Fv1%252Faccreditation%2520%252Fv1%252Faccreditations%2520%252Fdigiconso%252Fv1%2520%252Fdigiconso%252Fv1%252Fconsommations%2520new_meg%2520%252FDemande.read%2520%252FDemande.write%2520%252Fdigiraccob2c%252Fv1%26client_id%3Dprod_espaceclient%26state%3D%252Fclient%252Fparticulier%252Faccueil%26redirect_uri%3Dhttps%253A%252F%252Fmonespace.grdf.fr%252F_codexch%26nonce%3DlWBWS5HMVMXc95LVSReW_QycI6GJaV33wO3WlNKz81s%26by_pass_okta%3D1%26capp%3Dmeg&realm=/externeGrdf&capp=meg HTTP/1.1" 200 836
2022-11-02 21:10:37,276 DEBUG Cookies ok.
2022-11-02 21:10:37,277 DEBUG auth_nonce: 65687f900687f7e00d4c79f202d8423b
2022-11-02 21:10:37,277 DEBUG Logging ...
2022-11-02 21:10:37,277 DEBUG Logging payload : {'email': 'xxxxxxxxx@gmail.com', 'password': 'xxxxxxxxxx', 'capp': 'meg', 'goto': 'https://sofa-connexion.grdf.fr:443/openam/oauth2/externeGrdf/authorize'}
2022-11-02 21:10:37,410 DEBUG https://login.monespace.grdf.fr:443 "POST /sofit-account-api/api/v1/auth HTTP/1.1" 200 None
2022-11-02 21:10:37,411 DEBUG Logging returned : {"state":"REINPUT","error":"LOGIN_INVALID_ATTEMPTS","actualLockoutDuration":0,"message":"login.error.invalidattempts","displayCaptcha":true,"surname":"xxxxxxxx","name":"xxxxxxx","email":"xxxxxxxxxx@gmail.com"}
2022-11-02 21:10:37,412 INFO <Response [200]>
2022-11-02 21:10:37,412 INFO <RequestsCookieJar[<Cookie XSRF-TOKEN=13708522-1696-44ba-aca1-304368dd5cac for .grdf.fr/>, , <Cookie JSESSIONID=5BB83B7299906367EBA502FBB8F17A68 for login.monespace.grdf.fr/sofit-account-api>, <Cookie BIGipServerEXT_PRODPL-EXT_PROD-VS_P1_SIG-S_EPS_HTTPS_Internet=rd6o00000000000000000000ffff0a28a21bo443 for monespace.grdf.fr/>, , ]>
2022-11-02 21:10:37,412 INFO Login unsuccessful. Invalid returned information: {"state":"REINPUT","error":"LOGIN_INVALID_ATTEMPTS","actualLockoutDuration":0,"message":"login.error.invalidattempts","displayCaptcha":true,"surname":"xxxxx","name":"xxxxxx","email":"xxxxxxxx@gmail.com"}
2022-11-02 21:10:37,412 INFO Unable to login to GRDF website
2022-11-02 21:10:37,412 INFO Wait 20 seconds (0 min) before next try

@yukulehe
Copy link
Owner

yukulehe commented Nov 3, 2022

I don't know how to help you. Maybe change your password on GRDF website and retry.

@TheSleepySlee
Copy link

Works for me. Need to use simple password with no special characters.

@novisys
Copy link

novisys commented Nov 10, 2022

i confirm that the problem come from password with special characters , we need to use one without this until the script fix that 👍

@yukulehe yukulehe added bug Something isn't working and removed help wanted Extra attention is needed labels Nov 10, 2022
@yukulehe yukulehe changed the title Connection issue Connection issue when password contains any special character Nov 10, 2022
@yukulehe
Copy link
Owner

Thanks for your feedback.

@TheSleepySlee
Copy link

@yukulehe do you know how to bypass displayCaptcha ?

@yukulehe
Copy link
Owner

yukulehe commented Dec 5, 2022

Hello @TheSleepySlee .
You have a connexion issue ? Try to log-in on GRDF website and then relaunch the script.
Captcha is not blocking the connexion yet.

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

4 participants