chtzvt / PyEdsby

Python library for building integrations with the Edsby Student Information System.
MIT License
12 stars 4 forks source link

Cannot login with pyEdsby anymore - August 2018 update? #10

Closed kevxlreee closed 3 years ago

kevxlreee commented 6 years ago

Edsby pushed a significant August 2018 update with a new login process. Creating a new edsby object errors:

Traceback (most recent call last):
  File "/Users/user/Downloads/Edsby-Alerts-master/checkGrades.py", line 4, in <module>
    edsby = Edsby(host='host.edsby.com', username='username', password='password', nid='nid')
  File "/Users/user/Downloads/Edsby-Alerts-master/edsby.py", line 43, in __init__
    self.session = self.getSession()
  File "/Users/user/Downloads/Edsby-Alerts-master/edsby.py", line 120, in getSession
    return requests.Session().get('https://'+self.edsbyHost+"/core/login/"+str(self.instanceMeta['nid'])+"?xds=loginform&editable=true",headers=self.getHeaders())
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.18.4-py2.7.egg/requests/sessions.py", line 521, in get
    return self.request('GET', url, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.18.4-py2.7.egg/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.18.4-py2.7.egg/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/requests-2.18.4-py2.7.egg/requests/adapters.py", line 506, in send
    raise SSLError(e, request=request)
SSLError: HTTPSConnectionPool(host='host.edsby.com', port=443): Max retries exceeded with url: /core/login/host?xds=loginform&editable=true (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:661)'),))
chtzvt commented 6 years ago

I see- PyEdsby was built around the previous implementation, so if this is the case you will most likely have to re-implement that login flow in order to retrieve an authenticated session for the library.

I'm not sure whether or not all Edsby instances use this login flow, recently @EricRabil got his TypeScript implementation working with a similar method to what's used in PyEdsby.

Would you have any interest in submitting a PR for that?

kevxlreee commented 6 years ago

I will definitely try and get a PR together soon - thanks.

From what I've read this new update has been rolled out since August and should be finishing soon.

chtzvt commented 6 years ago

Fantastic! Thanks for the effort and the info, they’re greatly appreciated :)

hmnd commented 6 years ago

I've still got access to my instance, so I'll be able to work on this too.

hmnd commented 6 years ago

@kevxlreee Oh! That would be great. Could you send that to me at david@hmnd.io?

EricRabil commented 6 years ago

@kevxlreee Hi, I too am working on an Edsby library and having demo credentials would not only help me contribute to PyEdsby but also my own. If you are comfortable with the idea, could you also send credentials to me at ericjrabil@gmail.com?

chtzvt commented 3 years ago

@kevxlreee @EricRabil @hmnd @DanielThePear @thatmich

Hey, guess what!! @NatRoi TOTALLY SQUASHED THIS BUG (#12)!!!!