At the moment it seems that go-reddit only supports the latter use case -- oauthTransport uses Username + Password to obtain and renew access tokens.
In order to send requests to Reddit's API on behalf of multiple users, we need to support OAuth2 for "web apps". (see also the API docs). Should be a rather simple change, as the standard oauth2 library also supports exchanging code for token.
I am using go-reddit in one of my private projects and need this functionality, so I'll be happy to contribute a PR :)
Reddit API allows authorization for 3 app types:
At the moment it seems that
go-reddit
only supports the latter use case --oauthTransport
uses Username + Password to obtain and renew access tokens.In order to send requests to Reddit's API on behalf of multiple users, we need to support OAuth2 for "web apps". (see also the API docs). Should be a rather simple change, as the standard
oauth2
library also supports exchanging code for token.I am using
go-reddit
in one of my private projects and need this functionality, so I'll be happy to contribute a PR :)