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

Login using Shibboleth and via IP not working #13

Open
jmechnich opened this issue Apr 14, 2024 · 7 comments
Open

Login using Shibboleth and via IP not working #13

jmechnich opened this issue Apr 14, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@jmechnich
Copy link

When I was trying to login to filmfriend using my credentials for the "Universität Mannheim", I got the following error:

error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: <class 'KeyError'>
Error Contents: 'location'
Traceback (most recent call last):
  File "/Users/mechnich/Library/Application Support/Kodi/addons/plugin.video.filmfriend.de/default.py", line 52, in <module>
    login.pick()
  File "/Users/mechnich/Library/Application Support/Kodi/addons/plugin.video.filmfriend.de/resources/lib/login.py", line 175, in pick
    firstRedirectUrl = response.headers['Location']
                       ~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "/Users/mechnich/Library/Application Support/Kodi/addons/script.module.requests/lib/requests/structures.py", line 52, in __getitem__
  return self._store[key.lower()][1]
         ~~~~~~~~~~~^^^^^^^^^^^^^
KeyError: 'location'
-->End of Python script error report<--

After looking at the code it seems that login via Shibboleth is not supported (and probably also not that easy to implement). However, my university also supports login via IP if the host uses the university's network.

Unfortunately, at least in this case, sign in via IP is listed as a delegated login method and external takes precedence.

It would already be helpful if it was possible to explicitly select one of the login methods during login.

The following is the provider info for the "Universität Mannheim" (tenant id bffebeed-05f8-40bf-937d-aeada3e8a2b7):

{
  'local': None,
  'delegated': [
    {
      'provider': 'ff4da517-dd2a-4c50-936d-f38d155cc242',
      'displayName': 'Sign in via IP',
      'providerKind': 'Ip',
      'information': 'Sign in via IP',
      'userNameKind': None
    }
  ],
  'external': [
    {
      'provider': '15647c4b-2f6e-45c1-9643-c3c8e9ab17d1',
      'displayName': 'Sign in via Shibboleth',
      'providerKind': 'Shibboleth'
    }
  ]
}
@Ingo-FP-Angel Ingo-FP-Angel added enhancement New feature or request help wanted Extra attention is needed and removed help wanted Extra attention is needed labels Apr 16, 2024
@Ingo-FP-Angel
Copy link
Owner

Thanks for posting the provider info.

I have no experience with Shibboleth and looking at some introductory pages it looks significantly different to OpenId that I think I won't be able to implement this, especially since I have no way of analyzing real-world traffic. I'm tempted to create a separate issue with the "help-wanted" tag to find someone else for the implementation.

Login via IP might be easier to implement. Trying to login via IP to Uni Mannheim in a browser starts with the same kind of request like for my library, just with empty username and password (of course I get the error that my IP is not allowed to access: {"error":"Locked"}). So the current code might work without much changes except preferring "delegated ip" over "external shibboleth". I just guess that the personal watchlist won't work without a username. Or maybe it works technically - i.e. without an error - but just stays empty.

@jmechnich
Copy link
Author

I can confirm that I am able to complete the login process when forcing the authentication type to "delegated". However, at least on my Debian 12 desktop at the university, Kodi segfaults in a library from inputstream.adaptive when starting playback of a random movie from filmfriend. 😞

kodi_crashlog-20240416_214032.log

@Ingo-FP-Angel
Copy link
Owner

I've created a beta prerelease at https://github.com/Ingo-FP-Angel/plugin.video.filmfriend.de/releases/tag/1.0.11-beta.1

This will automatically use IP based login if that's the only supported way of authentication presented by the library.
In addition the addon will show an error if the library only uses providers that are not supported yet instead of simply crashing.

@Ingo-FP-Angel
Copy link
Owner

About the crash on playback, I think I can't really help. The only clue to me it seems is this error

libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init 

but it might not even be the cause of the crash.

Maybe it helps to update the inputstream.adaptive addon. The log shows version 20.3.2 and the most recent one is 20.3.18.

@jmechnich
Copy link
Author

I've created a beta prerelease at https://github.com/Ingo-FP-Angel/plugin.video.filmfriend.de/releases/tag/1.0.11-beta.1

This will automatically use IP based login if that's the only supported way of authentication presented by the library. In addition the addon will show an error if the library only uses providers that are not supported yet instead of simply crashing.

Thanks, this seems to work!

@jmechnich
Copy link
Author

About the crash on playback, I think I can't really help. The only clue to me it seems is this error

libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init 

but it might not even be the cause of the crash.

Maybe it helps to update the inputstream.adaptive addon. The log shows version 20.3.2 and the most recent one is 20.3.18.

The libva error should not be relevant: a number of drivers are tested consecutively and this one does not fit my graphics card. Generally, libva works fine.

@Ingo-FP-Angel
Copy link
Owner

Ingo-FP-Angel commented Apr 21, 2024

Thanks for testing. I've released v1.0.11 with the changes plus the usual meta data updates.

In order to support Shibboleth, would you be willing to capture the network traffic with the browser development tools while you're performing a login to the filmfriend web page? Be sure to remove username/password before sending me the captured data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants