Module Development

Install and Configure Simple OAuth for Drupal 8, 9, 10, and 11

The Simple OAuth module can be used to configure Drupal as an OAuth 2 authentication provider. Doing so will allow third-party applications to authenticate users using any of the OAuth flows, and validate their roles and permissions.

If you're creating applications that access Drupal's data and need to act like a logged-in user you'll want to use OAuth for authentication. There are 2 steps to accomplishing this: first, you'll need to set up Drupal to act as an authentication provider (this tutorial). Second, you'll need to make the appropriate HTTP requests to obtain an access token, which is covered in the next tutorial, Make an Authenticated Request Using OAuth 2.

In this tutorial we will:

  • Learn how to install the Simple OAuth Drupal module
  • Configure the Simple OAuth module so we can generate tokens that can authenticate users in Drupal
  • Demonstrate what the responses generated by the Simple OAuth module look like

By the end of this tutorial you should know how to install and configure the Simple OAuth module.

Decoupled Headless Drupal