-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* update log message * Commented-out code related to Okta SAML login process * Refactor comment formatting for network inspector logging instructions * remove comments and cleanup line lengths
- Loading branch information
1 parent
05ae986
commit 68be604
Showing
1 changed file
with
2 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
# | ||
# To filter FireFox network inspector when logging in: | ||
# `-regexp:woff|beacon|appdynamics|fonts|css|hotjar|usabilla|chat|ico|analytics|promo|nextprofilequestion|trackEvent | ||
# -mime-type:image` | ||
# -mime-type:image` | ||
# | ||
# Test with: | ||
# `python src/demo.py --utility smud --username [email protected] --password "mypassword" -v` | ||
|
@@ -275,49 +275,11 @@ async def async_login( | |
await SMUD.log_response(identity_oraclecloud_login_response, session) | ||
|
||
okta_saml_request_url = identity_oraclecloud_login_response.real_url | ||
|
||
_LOGGER.debug( | ||
"Fetching okta saml page with SAMLRequest, RelayState: %s", | ||
okta_saml_request_url, | ||
) | ||
|
||
okta_saml_request_response = await session.get( | ||
"RESPONSE from opower sso login page with OCIS_REQ_SP, RelayState: %s", | ||
okta_saml_request_url, | ||
headers={"User-Agent": USER_AGENT}, | ||
raise_for_status=True, | ||
) | ||
|
||
await SMUD.log_response(okta_saml_request_response, session) | ||
|
||
parser2 = SMUDOktaResponseSamlResponseValueParser() | ||
parser2.feed(await okta_saml_request_response.text()) | ||
saml_response = parser2.saml_response | ||
assert saml_response | ||
|
||
login_parser.feed(await okta_saml_request_response.text()) | ||
relay_state = login_parser.relay_state | ||
|
||
opower_sso_acs_url = "https://sso.opower.com/sp/ACS.saml2" | ||
|
||
_LOGGER.debug( | ||
"POSTing opower ACS sso page with SAMLResponse: %s", opower_sso_acs_url | ||
) | ||
|
||
opower_sso_acs_response = await session.post( | ||
opower_sso_acs_url, | ||
data={ | ||
"SAMLResponse": saml_response, | ||
"RelayState": relay_state, | ||
}, | ||
headers={"User-Agent": USER_AGENT}, | ||
raise_for_status=True, | ||
allow_redirects=True, | ||
) | ||
|
||
await SMUD.log_response(opower_sso_acs_response, session) | ||
|
||
_LOGGER.debug("End of SMUD login process") | ||
|
||
return | ||
|
||
@classmethod | ||
|