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

Support session based authentication #31

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kvalev
Copy link

@kvalev kvalev commented Feb 26, 2023

Newer Connect Box software uses a session-based authentication approach. This commit adds backwards compatible support for the new authentication approach and removes a couple of data model fields, which have been removed from the latest Connect Box software.

Follow up from #28

@kvalev kvalev force-pushed the kvv-support-latest-version branch 2 times, most recently from 41671ed to f6d67f9 Compare February 27, 2023 16:40
Newer Connect Box software uses a session-based authentication approach.
This commit adds backwards compatible support for the new authentication
approach and removes a couple of data model fields, which have been removed from
the latest Connect Box software.
@kvalev kvalev force-pushed the kvv-support-latest-version branch 2 times, most recently from ff0075c to f977880 Compare March 7, 2023 13:36
Add a configuration parameter whether the password should be sha256 encrypted.
Newer Connect Box models require an encrypted password, but leave it to the user
whether they want to do it themselves.
@kvalev kvalev force-pushed the kvv-support-latest-version branch from f977880 to ed498d2 Compare March 7, 2023 14:04
@@ -515,29 +519,49 @@ async def _async_initialize_valid_token(self) -> None:
timeout=10,
) as response:
await response.text()
#self.token = response.cookies["sessionToken"].value
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a Swiss Connect Box from UPC (LG-RDK_CH7465LG-NCIP-6.18-2206.7.2-NOSH) common_page/login.html give me a 404.

At first glances it looks like that _async_initialize_valid_token() is no longer needed.

Copy link
Author

@kvalev kvalev Mar 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the example script work for you when you remove the method? On my 6.15.20.3-GA-NOSH its still needed for the authentication flow

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6.18-x also has also some endpoints (e.g., rest/v1/login).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed a fix, which works for my version and hopefully for yours as well. Can you give it another go?

On older Connect Box software there is a permanent redirect to the index page,
while on newer ones the login page has been removed altogether.
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

Successfully merging this pull request may close these issues.

2 participants