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

Coursera Authentication Protocol changes again. #5

Open
cshung opened this issue Aug 26, 2014 · 6 comments
Open

Coursera Authentication Protocol changes again. #5

cshung opened this issue Aug 26, 2014 · 6 comments

Comments

@cshung
Copy link

cshung commented Aug 26, 2014

Session.cs need to change from

var data = string.Format("email={0}&password={1}", Uri.EscapeDataString(email), Uri.EscapeDataString(password));

to

var data = string.Format("email={0}&password={1}&webrequest=true", Uri.EscapeDataString(email), Uri.EscapeDataString(password));

Something else is still not working on GetCourseService returning 401, I can't figure that out. It would be great if you can help.

@cshung
Copy link
Author

cshung commented Aug 28, 2014

I think I have found a fix - let me test more - and when it is done I can submit a patch.

@ovatsus
Copy link

ovatsus commented Aug 29, 2014

The problem is that it seems .NET is not able to parse the cookies returned from the coursera website properly. Adding the &webrequest=true and parsing the cookies manually (fsprojects/FSharp.Data#670) solves the problem

@ovatsus
Copy link

ovatsus commented Aug 29, 2014

See also ovatsus/Apps@fb1ea9b

@cshung
Copy link
Author

cshung commented Aug 29, 2014

Thanks Ovatsus. I've got it fixed on my side.

@ovatsus
Copy link

ovatsus commented Aug 29, 2014

Out of curiosity, was that the same fix you were also doing, or were you doing something else?

@cshung
Copy link
Author

cshung commented Aug 29, 2014

I am working on a separate code base (my private one) and is mostly following the logic in this project. I am working on the Coursera Viewer app on Windows Store.

For the fix, yes, the same webrequest parameter, and the same fix to handle the fact that HTTP only cookies are not stored in cookieContainer and therefore need to parse the set-cookie header and put it back to CookieContainer.

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

No branches or pull requests

2 participants