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

Google Callback Error #164

Open
pausanchezv opened this issue May 17, 2024 · 6 comments
Open

Google Callback Error #164

pausanchezv opened this issue May 17, 2024 · 6 comments
Assignees
Labels
more info needed More info is needed in order to address the issue

Comments

@pausanchezv
Copy link

Hello,

Sometimes, no matter what I do, I receive this error and my users can't log in:

File "/usr/local/lib/python3.10/site-packages/fastapi_sso/sso/base.py", line 350, in verify_and_process
raise SSOLoginError(400, "'code' parameter was not found in callback request")

Please, note that I always use the latest version and I've been coming across this error in all versions.

Thank you.

@tomasvotava
Copy link
Owner

tomasvotava commented May 18, 2024

Hi! This is a pickle, because it is usually difficult to debug the callback, because you don't have much to work with (you have no response, the provider actually sends request to you).
I believe there may be more info in the header / query string, but I don't think there's an easy way in fastapi-sso to log this 🤔 There are some issues and PRs open, I will try to smuggle some increased logging in the next release so that you can turn it on and find out what's going on.

@tomasvotava tomasvotava self-assigned this May 18, 2024
@tomasvotava
Copy link
Owner

I will release a logging of callback request params and headers in the next version, you can try running it like this:

import logging

logging.basicConfig(level=logging.DEBUG)
# rest of your code

If the request does not contain code, you will get more info. Please note that the logs may contain some sensitive information, so check it before posting. Also, could you please specify which provider is generating the problem? Is this FacebookSSO?

@tomasvotava
Copy link
Owner

#167

@tomasvotava
Copy link
Owner

Please try with debug logging using 0.15.0 https://github.com/tomasvotava/fastapi-sso/releases/tag/0.15.0

@tomasvotava tomasvotava added the more info needed More info is needed in order to address the issue label May 18, 2024
@pausanchezv
Copy link
Author

pausanchezv commented May 19, 2024

https://github.com/tomasvotava/fastapi-sso/releases/tag/0.15.0

Hi, it's both, I have an email sent every time it crashes and a user can't log in. Usually I receive like 4 emails per day which is a bit too much. You can try it out yourself on my website as this is maybe the best way to see it (if it happens to you):
https://app.useofenglishpro.com

Also here are the screenshots:

image image

Also here's my implementation, in case it helps (it's the same thing for facebook):

image image

This last Raise is the one that gets the email sent and line 41 is the one that crashes.

Then, the next snippet, show what's crashing in your library:
image

Hope it helps!
Pau.

@tomasvotava tomasvotava mentioned this issue Jun 12, 2024
@tomasvotava
Copy link
Owner

Like I said in #173, we'll need to know more on what the provider is sending back to you. Please try using the aforementioned 0.15.0 release along with logging.DEBUG level. Please make sure the logs do not contain any sensitive information before you post them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info needed More info is needed in order to address the issue
Projects
None yet
Development

No branches or pull requests

2 participants