Emporia Energy Community › Support Center › Emporia App › Auth error in Python interface
- This topic has 1 reply, 2 voices, and was last updated 4 months, 3 weeks ago by John Polasek.
-
AuthorPosts
-
-
cwenergymonitorMember
I’m just getting started trying to automate data collection from a set of 10 Emporia Energy monitors.
My preferred way to access would be from a server running Php. I tried to get the Php gAPI code to work, and ran into technical problems so I’m now looking at the Python interface instead.
If I try to get the demo program to work running:
py emporia-energy-api-client.py cwenergymonitor@gmail.com <pw>
Where the <pw> is the password that works for me to log into https://partner.emporiaenergy.com. I get this error:
Traceback (most recent call last):
File “C:\Users\danie\Google Drive\Carol Woods\Energy Monitoring\Emporia API\Python\emporia-energy-api-client.py”, line 50, in <module>
auth_response = stub.Authenticate(request=request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\danie\AppData\Local\Programs\Python\Python312\Lib\site-packages\grpc\_channel.py”, line 1181, in __call__
return _end_unary_response_blocking(state, call, False, None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\danie\AppData\Local\Programs\Python\Python312\Lib\site-packages\grpc\_channel.py”, line 1006, in _end_unary_response_blocking
raise _InactiveRpcError(state) # pytype: disable=not-instantiable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAUTHENTICATED
details = “Incorrect username or password. (Service: CognitoIdentityProvider, Status Code: 400, Request ID: 7c72b142-cfc2-4248-8eb9-870008258e7d)”
debug_error_string = “UNKNOWN:Error received from peer {created_time:”2024-06-15T20:01:15.1962337+00:00″, grpc_status:16, grpc_message:”Incorrect username or password. (Service: CognitoIdentityProvider, Status Code: 400, Request ID: 7c72b142-cfc2-4248-8eb9-870008258e7d)”}”Do you have any suggestions?
-
John PolasekMember
They may have disabled the capability. Last week I began getting failures in the Java emporia downloader interface that had been working for years:
30 Jun 2024 00:00:01 – INFO (EmporiaDownloader.java:301): Starting run!
30 Jun 2024 00:00:02 – INFO (CognitoAuthenticationManager.java:149): logging in
30 Jun 2024 00:00:03 – ERROR (IdToken.java:50): Cannot extract IdTokenPayload from eyJraWQiOiJ6Yjhpb1wvSEJnaUFBOWJZb0p6U0NQcVZCTGp3ZkZVam8zM1BGK2NlZGxIdz0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIxYjFlNjhkYy02ZjlkLTRkY2QtYmE1OC0yZWExMGFjYTFkY2QiLCJ3ZWJzaXRlIjoiZW1wb3JpYWVuZXJneS5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMi5hbWF6b25hd3MuY29tXC91cy1lYXN0LTJfZ2hsT1hWTGkxIiwiY29nbml0bzp1c2VybmFtZSI6IjFiMWU2OGRjLTZmOWQtNGRjZC1iYTU4LTJlYTEwYWNhMWRjZCIsImF1ZCI6IjRxdGU0N2pic3RvZDhhcG5maWMwYnVubXJxIiwiZXZlbnRfaWQiOiIxY2ViNDQwZS1hMWMxLTQxMDItYjE3NC02ZmQ2NDAwNTdhZTEiLCJ0b2tlbl91c2UiOiJpZCIsImF1dGhfdGltZSI6MTcxOTcyMzYwMywibmFtZSI6IkpvaG4gUG9sYXNlayAiLCJleHAiOjE3MTk3MjcyMDMsImlhdCI6MTcxOTcyMzYwMywiZW1haWwiOiJqLnBvbGFzZWtAYnJlLmNvbSJ9.Tp9K0231W-Pw1OPanGEiiyzBDT-4L0jo0HyOiEqkmJyLcsVbAe19IlwMO_M6lIHCCFIIRoLPZAsnszwlDXVWZ6ZyimEgaIQUPSa5ArmB09eruVZ2zgokhMSsdp2COJ-dKc_exNhfPpNA_tFhV0WvBXpoUAYTYZczfl9hhcFCi-C-UgY1T9ERN0p0UaY8mQxfuURm3UH9qtXtcWgZvwjhE1V6Sl1ePpdvanQk64dg01ae_K80roVhLpkbVXNwaX2JamEfLod_Msur1_H03mgdYevPcbAjEEDeoNbjDCavL-LxAthGyHW2Q7ndQIv4gB_qf5XwLDbJAiAH-57nc4SbhA
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field “website” (class org.grajagan.aws.token.IdTokenPayload), not marked as ignorable (12 known properties: “event_id”, “token_use”, “auth_time”, “iss”, “name”, “iat”, “exp”, “cognito:username”, “sub”, “email_verified”, “email”, “aud”])
at [Source: (String)”{“sub”:”1b1e68dc-6f9d-4dcd-ba58-2ea10aca1dcd”,”website”:”emporiaenergy.com”,”email_verified”:true,”iss”:”https:\/\/cognito-idp.us-east-2.amazonaws.com\/us-east-2_ghlOXVLi1″,”cognito:username”:”1b1e68dc-6f9d-4dcd-ba58-2ea10aca1dcd”,”aud”:”4qte47jbstod8apnfic0bunmrq”,”event_id”:”1ceb440e-a1c1-4102-b174-6fd640057ae1″,”token_use”:”id”,”auth_time”:1719723603,”name”:”John Polasek “,”exp”:1719727203,”iat”:1719723603,”email”:”EMAIL REPLACED”}”; line: 1, column: 58] (through reference chain: org.grajagan.aws.token.IdTokenPayload[“website”])
at com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException.from(UnrecognizedPropertyException.java:61) ~[emporia-downloader.1.2.jar:?]
at com.fasterxml.jackson.databind.DeserializationContext.handleUnknownProperty(DeserializationContext.java:823) ~[emporia-downloader.1.2.jar:?]
at com.fasterxml.jackson.databind.deser.std.StdDeserializer.handleUnknownProperty(StdDeserializer.java:1153) ~[emporia-downloader.1.2.jar:?]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownProperty(BeanDeserializerBase.java:1589) ~[emporia-downloader.1.2.jar:?]
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.handleUnknownVanilla(BeanDeserializerBase.java:1567) ~[emporia-downloader.1.2.jar:?]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:294) ~[emporia-downloader.1.2.jar:?]
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151) ~[emporia-downloader.1.2.jar:?]
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4014) ~[emporia-downloader.1.2.jar:?]
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3005) ~[emporia-downloader.1.2.jar:?]
at org.grajagan.aws.token.IdToken.fromJWT(IdToken.java:48) [emporia-downloader.1.2.jar:?]
at org.grajagan.aws.AuthenticationResult.getIdTokenContent(AuthenticationResult.java:90) [emporia-downloader.1.2.jar:?]
at org.grajagan.aws.AuthenticationResult.toString(AuthenticationResult.java:55) [emporia-downloader.1.2.jar:?]
at org.grajagan.aws.CognitoAuthenticationManager.isInvalid(CognitoAuthenticationManager.java:108) [emporia-downloader.1.2.jar:?]
at org.grajagan.aws.CognitoAuthenticationManager.authenticate(CognitoAuthenticationManager.java:142) [emporia-downloader.1.2.jar:?]
at org.grajagan.aws.CognitoAuthenticationManager.getIdentityToken(CognitoAuthenticationManager.java:80) [emporia-downloader.1.2.jar:?]
at org.grajagan.emporia.api.EmporiaAPIInterceptor.intercept(EmporiaAPIInterceptor.java:44) [emporia-downloader.1.2.jar:?]
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142) [emporia-downloader.1.2.jar:?]
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117) [emporia-downloader.1.2.jar:?]
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229) [emporia-downloader.1.2.jar:?]
at okhttp3.RealCall.execute(RealCall.java:81) [emporia-downloader.1.2.jar:?]
at retrofit2.OkHttpCall.execute(OkHttpCall.java:188) [emporia-downloader.1.2.jar:?]
at org.grajagan.emporia.api.EmporiaAPIService.getCustomer(EmporiaAPIService.java:110) [emporia-downloader.1.2.jar:?]
at org.grajagan.emporia.EmporiaDownloader.run(EmporiaDownloader.java:310) [emporia-downloader.1.2.jar:?]
at org.grajagan.emporia.EmporiaDownloader.main(EmporiaDownloader.java:150) [emporia-downloader.1.2.jar:?]I am not sure ow to contact the author of this program since he apparently retired and locked the GitHub page for it a year ago.
-
-
AuthorPosts
- You must be logged in to reply to this topic.