[RedditBridge] Use OAuth2 token and endpoint for accessing the JSON API - #5039
Draft
Electronic-Mango wants to merge 2 commits into
Draft
[RedditBridge] Use OAuth2 token and endpoint for accessing the JSON API#5039Electronic-Mango wants to merge 2 commits into
Electronic-Mango wants to merge 2 commits into
Conversation
Add Reddit authorization via OAuth2 and legacy developer script "app". Username/password (or app ID/secret) are read from "config.ini.php", as configuration specific to RedditBridge.
On first 401/403 try to refresh the OAuth2 token and try to send the request one more time.
Pull request artifacts
last change: Monday 2026-07-13 22:25:25 |
Contributor
|
hmm maybe a new bridge for this i prefer a new class RedditClient |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow users to specify their own Reddit utility script app credentials to use OAuth2 authorized version of the API, since Reddit disabled unauthenticated JSON requests.
The new parameters are configured through
config.php.iniand RedditBridge specific configuration:"Solves" #4866 and #3802, however there are two problems:
As for 1. - I'm not sure if there's a different approach, than private instances. I could modify the bridge to require those credentials via regular bridge parameters, but passing secrets through query seems like a bad idea.
As for 2. - I'm not even sure if it's worth merging such change, as it's impossible to use the bridge without having already working app. The bridge does work if you do, but you can't get it working if you didn't create the app in the past.
Due to this I'm creating it as draft for now, but perhaps it will be useful for someone with already existing app.