Proof of concept: Generic OAuth - #162
Conversation
|
I tried running this PR with Twitch Oauth provider as a test, but I run into an issue For the "OAuthPathToken" request, Discord wanted in the body of the POST request but Twitch uses query parameters (even on POST request) |
|
Another issues comes when trying to call the |
I'm confused by this. The POST request is being made with a
Isn't that exactly the way Twitch also expects the request data? And with the same contents? Getting the user info endpoint I guess should also work out with the JsonPaths... Not too hard to include that though, as an optional thing in some way. What's going wrong with the token request when you run it? |
Ok it was a misunderstanding of the logs but now I am wondering how my old code worked, because I already used Twitch Oauth2 before and it is running fine with having the parameters as query parameters. The only error is the Client ID as a header. |
|
I tried working on this PR to have something fully working https://github.com/fantomitechno/CelesteNet/tree/generic-oauth-providers For the Client ID in header, I chose to have a settings I also added the changes to the Frontend: When authentified, I also added a And finally, to make sure that there is no possibility for UID collision, I changed the UID format to be |




Still a bunch of things I'd have to clean up, but this is more like what I had in mind for supporting arbitrary OAuth2 providers
(YAML is absolute lunacy with how it doesn't serialize those JSONPaths as strings......)
3. Advantages: When requesting
ServiceUserAPIwhich we don't know what exactly it returns, just try to parse it with config-provided JSONPaths 🙂https://www.newtonsoft.com/json/help/html/QueryJsonSelectToken.htm
https://goessner.net/articles/JsonPath/
PS:
Don't mind the change in client EmojiComponent...... I was lazy with my unstaged changes :)Moved that bit to #167