Advertising sustains the DA. Ads are hidden for members. Join today

Social Auth Reddit 2.x - Installation instructions

Last updated on
12 January 2019

Social Auth Reddit module depends on The League OAuth2 Reddit library and uses Composer to download it. Composer can automatically download the correct version of the library for you.

Overview of installation steps

  1. Step 1: Create a Reddit application and get credentials by going to  https://www.reddit.com/prefs/apps and clicking "are you a developer? create an app..."
  2. Step 2: Download Social Auth Reddit and The League OAuth2 Reddit library using Composer.
  3. Step 3: Enable and configure Social Auth Reddit module.

Step 1: Create a project

Step 2: Install Social Auth Reddit and The League Reddit Provider for OAuth 2.0.

On the command line, navigate to your Drupal root directory.

Let Composer download Social Auth Reddit (and all its dependencies). The following command will download the latest 2.x release of Social Auth Reddit:

composer require "drupal/social_auth_reddit:~2.0"

If you would like to use the 2.x-dev version instead, use the following command:

composer require "drupal/social_api:2.x-dev" "drupal/social_auth:2.x-dev" "drupal/social_auth_reddit:2.x-dev"

Social Auth Reddit dev versions are usually only compatible with Social Auth and Social API dev versions. The command above installs the dev branch of all these modules.

Composer will automatically download rtheunissen/oauth2-reddit

Step 3: Enable and configure Social Auth Reddit module

Now that Composer has downloaded The League OAuth2 Reddit library and other dependencies, you can enable Social Auth Reddit.

  • The module settings can be configured on /admin/config/social-api/social-auth/reddit
  • Add your Client ID and Client Secret (from step 1) to the module settings
  • You probably also want to check your Drupal account settings at /admin/config/people/accounts, making sure that visitors can create accounts

Check installation status and give it a try!

  • After you have completed steps 1-3 above, verify that you can see that Composer has downloaded The League OAuth2 Reddit library to vendor/rtheunissen/oauth2-reddit directory of your Drupal installation.
  • Add a Social Auth Login block to any region. If you already have added a block before installing this module and nothing is shown, try rebuilding the cache
  • Click on the "Reddit" logo
  • Alternatively, you can add a link anywhere on the site that points to user/login/reddit

Support requests

  • Before posting a support request, carefully read the installation instructions provided on this page and do the setup in this order.
  • Once you have done this, you can post a support request at module issue queue. Support requests to the issue queue, please, not to the comments on this documentation page.
  • When posting a support request, please inform if you were able to see any errors in the Recent Log entries.

Available Scopes for Social Auth Reddit 2.x

Below you'll find the list of all available scopes that you can enter in /admin/config/social-api/social-auth/reddit and their respective descriptions. By default, the identity and read scopes are already added. The descriptions below are written as they are displayed to the user when they are authorizing your website. The additional scopes:

creddits - Spend my reddit gold credits on giving gold to other users.

modcontributors - Add/remove users to approved submitter lists and ban/unban or mute/unmute users from subreddits I moderate.

modmail - Access and manage modmail via mod.reddit.com.

modconfig - Manage the configuration, sidebar, and CSS of subreddits I moderate.

subscribe - Manage my subreddit subscriptions. Manage "friends" - users whose content I follow.

structuredstyles - Edit structured styles for a subreddit I moderate.

vote - Submit and change my votes on comments and submissions.

wiki - Edit wiki pages on my behalf

mysubreddits - Access the list of subreddits I moderate, contribute to, and subscribe to.

submit - Submit links and comments from my account.

modlog - Access the moderation log in subreddits I moderate.

modposts - Approve, remove, mark nsfw, and distinguish content in subreddits I moderate.

modflair - Manage and assign flair in subreddits I moderate.

save - Save and unsave comments and submissions.

modothers - Invite or remove other moderators from subreddits I moderate.

read - Access posts and comments through my account.

privatemessages - Access my inbox and send private messages to other users.

report - Report content for rules violations. Hide & show individual submissions.

identity - Access my reddit username and signup date.

livemanage - Manage settings and contributors of live threads I contribute to.

account - Update preferences and related account information. Will not have access to your email or password.

modtraffic - Access traffic stats in subreddits I moderate.

wikiread - Read wiki pages through my account

edit - Edit and delete my comments and submissions.

modwiki - Change editors and visibility of wiki pages in subreddits I moderate.

modself - Accept invitations to moderate a subreddit. Remove myself as a moderator or contributor of subreddits I moderate or contribute to.

history - Access my voting history and comments or submissions I've saved or hidden.

flair - Select my subreddit flair. Change link flair on my submissions.

If you want to learn more about the reddit API and want to tweak the code itself, I recommend reading the Reddit OAuth API Guide.

Help improve this page

Page status: No known problems

You can: