piazza-api icon indicating copy to clipboard operation
piazza-api copied to clipboard

login failing "Email or password incorrect"

Open langdon opened this issue 2 years ago • 10 comments

However, I have confirmed 5 ways from sunday that the email and password are correct. I experimented with adding urlencoding to the user and pass but that does not seem to be helping. Any ideas? Would really like to be able to use your library to script some of my piazza posts.

langdon avatar Nov 06 '23 19:11 langdon

tagging @savantes1 for the most recent PR about login.

langdon avatar Nov 06 '23 19:11 langdon

I was having a login issue as well. However, it seems to be working on my end after I went into rpc.py and changed line 81 from data=f'from=%2Fsignup&email={email}&password={password}&remember=on&csrf_token={csrf_token}' to

data={
   'csrf_token': csrf_token,
   'email': email,
   'password': password
}

Let me know if this helps.

EddieJ03 avatar Dec 24 '23 17:12 EddieJ03

It worked for me. Thanks!

mrnhtyzgld avatar May 25 '24 19:05 mrnhtyzgld

Happy to accept the above fix as a PR if anyone would like to put one forth.

hfaran avatar May 30 '24 00:05 hfaran

hey @hfaran! I have a question about this project, where can i reach you, i have a question about how this works, can i get ur email or smth?

mrnhtyzgld avatar May 30 '24 21:05 mrnhtyzgld

@mrnhtyzgld Feel free to ask any questions here or open a new issue on Github if you have a different question

hfaran avatar May 30 '24 22:05 hfaran

I'll try to take a look at this today or tomorrow and, hopefully, put in a PR

savantes1 avatar May 30 '24 22:05 savantes1

@hfaran you didnt return to my issue, can you return when available? Sorry for asking.

mrnhtyzgld avatar Jun 03 '24 18:06 mrnhtyzgld

So, clearly, when I said "today or tomorrow", I meant "next week" ;)

I'm pretty sure the pull request I just submitted should resolve this problem

savantes1 avatar Jun 06 '24 00:06 savantes1

#71 doesn't/shouldn't fix this issue, since changing f-strings to str.format is merely a Python syntax difference (with better backwards-compatibility for old Python versions) that doesn't change the actual functionality/submission at all. if that were really the issue then the error would be a Python syntax error, not a "login failed" error.

I'm not sure whether the underlying cause for this specific issue is since the author mentioned they tried urlencoding; maybe it wasn't done correctly? because afaik the only difference between manually string-encoding the form data and using a dict is whether the payload gets urlencoded behind the scenes by requests.

anyway, i submitted PR #72 to implement @EddieJ03's suggested fix (https://github.com/hfaran/piazza-api/issues/68#issuecomment-1868566700).

kwshi avatar Oct 21 '24 22:10 kwshi