Provider – Twitch

Twitch Sample

Table of contents

How to enable Twitch login in WordPress

1. Create a Twitch App

To be able to log in via Twitch you must create a Twitch App first.

  1. Open the Twitch Developer Console and login with your Twitch account.
  2. To create a Twitch App your account both needs:
    • to be verified
    • and to have the Two Factor Authentication enabled. If it is not enabled already, you can enable it at your Settings page on the Security and Privacy tab
  3. Navigate to the Applications tab.
  4. Click on the “+ Register Your Application” button on the right side.
  5. Enter a “Name” for your App.
  6. Into the “OAuth Redirect URLs” field you should enter the URL that Nextend Social Login suggests at the backend.
  7. Select the “Website Integration” option in the “Category” list.
  8. Complete the human verification test.
  9. Press the “Create” button.
  10. On the “Applications” tab, find your app and click “Manage“.
  11. To generate a “Client Secret“, click on the “New Secret” button.
  12. Copy the “Client ID” and the “Client Secret” values. These will be needed in the plugin’s settings.

2. App setup

Once your Twitch app is ready you’ll need to copy and paste the Client ID and Client Secret to the Twitch provider’s Settings tab. You can find the information at your Twitch app’s Applications tab.

3. Verifying

Once your Client ID and Client Secret has been added you need to verify the setup first. This verification helps you identify possible problems with the app.

Settings

Twitch Settings

Client ID

The Client ID of your Twitch app. You can find it as it is described in the App setup guide.

Client Secret

The Client Secret of your Twitch app. You can find it as it is described in the App setup guide.

Force reauthorization on each login

When enabled, the users will be asked to reauthorize the Twitch App each time they login with Twitch.

Twitch Other Settings

Username prefix on Register

Whenever a new user registers with a Twitch account they can get a custom prefix so you can easily identify them.

Fallback username prefix on register

Whenever a new user registers with a Twitch account and we can not generate a valid username from the first name or last name, a random username will be generated. With this option they can get a custom prefix so you can easily identify them.

Terms and conditions

This option can only be seen, if Terms and conditions is set to Show in Global Settings β†’ Privacy tab. Here you can set custom Terms and Conditions for users who register with Twitch. For more information please read our GDPR documentation.

Sync data

By default Nextend Social Login stores the first name, last name, email, avatar url and access token if it is possible, however some additional information can also be retrieved and stored.
When an option is checked, that field will be stored in a meta key with the specified name.

Twitch Sync Data

Sync fields

It determines when the synchronization shall happen.

  • Register: whenever a new user registers with a provider, their data will be retrieved and stored.
  • Login: whenever user logs in with a provider, their data will be retrieved and stored.
  • Link: whenever user links and existing WordPress account with a provider, their data will be retrieved and stored.

User login name

Stores the user’s Twitch login name.

Type

Stores the user’s Twitch account type name. The returned value can be either “staff”, “admin”, “global_mod”, or empty. If it is empty, we won’t create an unnecessary meta record.

Broadcaster type

Stores the user’s broadcaster type: The returned value can be either “partner”, “affiliate”, or empty. If it is empty, we won’t create an unnecessary meta record.

Description

Stores the user’s channel description.

Creation Date

Stores the date when the user’s Twitch account was created.

Common error messages returned by Twitch during verification

invalid client

{“status”:400,”message”:”invalid client”}


The problem is that the entered Client ID is not correct, maybe the app with the entered Client ID was deleted. Check the 12th step of the App setup to fix the problem.

invalid client secret

Error: 403 – invalid client secret


The Client Secret that you copied from the Twitch app is invalid. Make sure the correct one was copied. Check the 11th and 12th steps of the App setup to fix the problem.

The popup stays open with your website in it

You are about to leave Twitch.
Twitch has no control over the content or security of https://example.com.


The problem is that the entered “OAuth Redirect URLs” field is not correct for your app. Check the 6th step of the App setup to fix the problem.