Open sorendayton opened 1 year ago
You best tool would be the web developer tools, network tab, in your browser. Navigate to the login page of your utility website and try to identify what endpoints you need to replicate in Python. Yours seems to use the opower domain itself which I haven't seen before. It posts to https://dss-smcc.opower.com/webcenter/edge/apis/identity-management-v1/cws/v1/smcc/login the following:
username: test
password: test
rememberMe: true
which is easy to replicate in Python. After that without access to your account you are on your own to figure out how to get the access token for opower. For your case since you are logging in directly to opower you likely don't need any access token and just the session cookie would be enough.
What does an access token look like? Is it named? My response has quite a few good looking options for an auth token
If yours is using an access token you should be able to tell by the authorization HTTP header in requests to opower.com
It will look like https://github.com/tronikos/opower/blob/addb89460e6b578250ee5ec6ca00a5f2a40b5b0d/src/opower/opower.py#L493C22-L493C68 e.g. authorization: Bearer <access-token>
If yours is using SAML you can tell if you see a request to opower.com/sp/ACS.saml2
https://github.com/tronikos/opower/blob/addb89460e6b578250ee5ec6ca00a5f2a40b5b0d/src/opower/utilities/helpers.py#L30C34-L30C57
Sweet! I found it. https://login.nationalgrid.com/loginnationalgridus.onmicrosoft.com/b2c_1a_nationalgrid_convert_merge_signin/oauth2/v2.0/token returns the access_token. But theres also a “scope url” of https://login.nationalgridus.com/opower-uwp/opower Looks the body of the request includes: signInName=xxx@email.com&password=xxxxxx&Signin-forgotPassword=FORGOT_PASSWORD_FALSE&request_type=RESPONSE
the opower subdomain after my succeeded login is: ngli.opower.com It looks like NationalGrid has many subdomains though for different areas.
what provider would you recommend I copy?
Whichever you want.
I would love to compare notes as I develop mine. I have gotten distracted by other stuff, but this is something I want to do in the new year.
On Mon, Dec 25, 2023 at 11:42 AM disforw @.***> wrote:
Sweet! I found it.
https://login.nationalgrid.com/loginnationalgridus.onmicrosoft.com/b2c_1a_nationalgrid_convert_merge_signin/oauth2/v2.0/token returns the access_token. But theres also a “scope url” of https://login.nationalgridus.com/opower-uwp/opower Looks the body of the request includes: @.*** &password=xxxxxx&Signin-forgotPassword=FORGOT_PASSWORD_FALSE&request_type=RESPONSE
the opower subdomain after my succeeded login is: ngli.opower.com It looks like NationalGrid has many subdomains though for different areas.
what provider would you recommend I copy?
— Reply to this email directly, view it on GitHub https://github.com/tronikos/opower/issues/55#issuecomment-1869050464, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4MAX2NLY7YJDTD2L6PKWW3YLGUHJAVCNFSM6AAAAAA7GMBD6CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRZGA2TANBWGQ . You are receiving this because you authored the thread.Message ID: @.***>
@sorendayton awesome, I’m going to post my findings under a different opened thread that relates to my provider. There are othere people there that may be able to add some insight for me. Check out #45
@sorendayton, City of Austin Utilities also uses Opower with a similar domain: dss-coa.opower.com I hope that any progress you make with your provider can help me as well.
A whole bunch more just dropped. I want to get back to this in the new year. It looks like a lot of the additions are part of AEP, but I want to experiment some.
On Wed, Jan 3, 2024 at 9:03 PM atx32 @.***> wrote:
@sorendayton https://github.com/sorendayton, City of Austin Utilities also uses Opower with a similar domain: dss-coa.opower.com I hope that any progress you make with your provider can help me as well.
— Reply to this email directly, view it on GitHub https://github.com/tronikos/opower/issues/55#issuecomment-1876208640, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4MAX2M5QPR6DNZD63ZSBO3YMYEVTAVCNFSM6AAAAAA7GMBD6CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZWGIYDQNRUGA . You are receiving this because you were mentioned.Message ID: @.***>
Cool, another one DSS Opower provider. Hope my changes could help with this one too. Auth flow could be different but I hope that portals are similar.
@sorendayton, @max2697 refers to their #64. City of Austin Utilities also uses DSS so their implementation should hopefully help you.
Hi,
My provider, the Southern Maryland Electric COoperative (SMECO) uses OPOWER.
I looked through the source code for some of the other providers, and it looks like the user isn't directly using the OPOWER domain (although I am not quite tracking the subdomain use), but they are going through the utility's main website.
For example, when I am logged in, I am at a URL like:
https://dss-smcc.opower.com/dss/energy/use-details?ou-data-browser=/neighbors/electricity/year/2022-11-19?accountUuid%XXXXXXX
I have a screenshot below.
What would be the closest code to start with in trying to create something for this provider? Thanks!