biw / myCUinfo-API

An API for the myCUinfo system at CU Boulder

Home Page:http://mycuinfo.colorado.edu

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Updates and maintenance

AparaV opened this issue · comments

Hey,

Are you still actively maintaining (and updating) the API and accepting pull requests with new features?

~Apara (fellow CU student)

Hi Apara, I haven't updated the API in about two years.I am always willing to take new pull requests and/or features! Let me know if you have any questions!

Awesome! I think I have an idea for a new feature. I'll let you know if it goes well with a pull request!

Awesome! Feel free to submit any other changes too, it's an old project and definitely needs some cleaning up!

I think how the authentication system works has changed a lot in the last 2 years.

For starters, the original 'http://mycuinfo.colorado.edu' has been set up to automatically redirect to the new link. So I edited that part.
Even after editing that (and the payload keys), I cannot get past the login page. I am redirected to a Stale Request page that says something like this:

<p>
You may be seeing this page because you used the Back button while browsing a secure web site or application.
Alternatively, you may have mistakenly bookmarked the web login form instead of the actual web site you wanted to bookmark or used a link created by somebody else who made the same mistake.
</p> <br/>
<p>
Left unchecked, this can cause errors on some browsers or result in you returning to the web site you tried to leave, so this page is presented instead.
</p>

Am I doing something wrong? (or is this hopeless and that's why you stopped updating it? 😞)

Hi Apara,

The authentication probably does not work due to the updates that the University made in the work to unify the IdentiKey login flow across all their sites. However, things are definitely not hopeless (I just stopped working on the project I originally made this for). I probably should have explain this somewhere in the README, but I'll do it here and copy it over later if it still applies to the new system. The basic login flow for mycuinfo.colorado.edu goes through a few steps (pretty sure it's about the same login flow from the error you are getting).

The mycuinfo system is designed so that bots cannot use it. The mycuinfo.colorado.edu is only a redirect for users of the system, it was also this way two years ago, so you have to hit that url first in order to start the login process. After a user hits the mycuinfo.colorado.edu domain, the system registers them with a session token. You are missing a session token (I think it's cookies and POST data, but don't remember) and is the reason you are getting the Stale Request page. The way the system gives you a session token is through multiple javascript redirects. However, the University also supports non-javascript client, which makes things way easier (only for login, the majority of the site when you login doesn't work without javascript). In order to figure out the new login flow, our program needs to step through each step of the login flow like a "real" client would. If at any point you get the error above (or anything like it), you didn't do something a real client would do. So once we figure out the login flow, it's pretty easy to get logged in.

I don't currently have the bandwidth to look into the new system now, but happy to answer any questions you might have about the old one. I should also be able to look into more next week!

Thanks for the quick reply Ben!

I also noticed something now, after you mentioned the javascript redirects. After disabling javascript in my browser, I couldn't reach the final login page for myCUinfo. Perhaps they made it mandatory to have javascript enabled to login?

This is my first time using requests (properly), so I'm still learning along the way.

Thanks for your help with the new system. In the meantime, I'll also try figuring out the new login flow. I'll let you know if I find something/have any questions

Hi @AparaV,

I was able to get the login flow working but definatly looking for some help with fixing all the date functions like .books() and .classes() if you want to help out. #6

Hey @719ben

Thanks! I'm able to successfully login now!
But, I noticed that the code breaks in the .classes() function. I'd love to help you fix the outdated code!

PR with fixed .classes() coming soon!

@AparaV I would take a look at #7 also before writing

@719ben Thanks for the heads up! I'm modifying a different part of the code (the function .classes()). So, there shouldn't be any conflicts
Tagging @KyleRosenberg to make sure he is aware of this.

commented

@AparaV I have already submitted commits for .classes() and .books()

@KyleRosenberg oops! Must have missed those commits when I first read it. Sorry about that!