-
Notifications
You must be signed in to change notification settings - Fork 57
Application Only OAuth #62
Comments
This 2-legged OAuth scenario is not currently supported in the SDK. After looking through the requirements for getting this working, this should just require some alterations to the constructor to pass through a different grant_type (and a device id) in the initial request. That should produce back the access token needed. All user centric methods would still be available in the SDK, but they would fail with a 403 back from Reddit servers. This would probably be the easiest way of getting it working. Let me take a look once I can. |
So you mean that even if it worked, the API would not allow to write the story to the subreddit ? Thank you very much for your follow up. |
Any updates on getting this working? There are many third-party apps that allow the user to post without authenticating every time so this must be possible. |
I added the following. I had to create a prime.php page to auth and pull the initial access and refresh tokens but after that everything works. To use permanent tokens you store the access token and refresh token somewhere. Then you make calls with the access token until it expires, when it expires you re auth but with refresh token and then update. Refresh token is not updated. NOTE: duration=permanent and I tried my best to obfiscate my implementation and leave the needed info. wtformatting...
|
I have a script that posts a story to one of my subreddits. At some point this script should be launched via a cronjob.
This is where I'm stuck: my script works inside a user context, but not without manual authorization, which is necessary for the cron workflow.
I've read this page on the reddit API wiki, but do not understand how to make it work using the php SDK.
The text was updated successfully, but these errors were encountered: