Hi! I'm trying to implement a custom provider for ...
# support-questions
i
Hi! I'm trying to implement a custom provider for reddit. Details in the thread
Getting this error in my custom signInUpPost implementation after the part where I authorize via reddit. "invalid character '<' looking for beginning of value"
This is my implementation: https://pastebin.com/QUP5VBAA
Discord works great, it's just the reddit one that has an issue.
GetProfileInfo also didn't trigger
r
Hey @Infatuation
What is the stack trace of the error?
i
@rp
r
Do you know which line in your code causes this issue?
As in is it within the originalImplemtation call?
ok i am able to reproduce the error on my system!
So the issue is that the API is returning a 429 response. The
https://www.reddit.com/api/v1/access_token
API call
And several people seem to be having this issue with no solution.. even other oauth2 packages don't seem to work....
We can investigate this issue further at some point in the future. Feel free to open an issue about this.
Solutions online say that we have to set a custom User-Agent for reddit to not rate limit the access_token call, but that doesn't work either - reddit still returns a 429. People online too face this issue even when setting different user-agents in the request header.
I have made an issue about this: https://github.com/supertokens/supertokens-golang/issues/87 It highlights how to reproduce the error and what to change in the SDK so that you can try and fix it.
i
Hmm, I think I actually experienced this when I implemented reddit auth using Goth, let me go see what I did there as well.
I remember it being very particular, the user agent I used that worked was
linux:beatbattle:v1.3 (by /u/infatuationpsa)
I was actually using the go-reddit package if that helps: https://github.com/cameronstanley/go-reddit
r
ah ok! let me try that
even after attaching the user-agent as mentioned above, reddit still gives a 429.
It's so strange..
i
Hey, opening this issue up again months later since I'm back on this project. I got some small progress by setting GODEBUG=http2client=0 in my env, which now lets me get to a 401 auth code response. Bit better than the 429, but still not sure what else to do. It also seems like using a TLS RoundTrip protocol on the http client solves this without disabling http2 client support
r
Hmmm
Im not sure how to help here. It really does seem like reddit doesn't want other sites to use sign in with Reddit
i
That's a shame, I'll just deprecate reddit sign in anyways, too much of a hassle
r
Fair enough
i
I just started using SuperTokens though in production and it's going well so far! Thanks for all your help
r
Great to hear that 🙂 happy to help!