Skip to content

Oauth2 Client

Introduction

The OAuth2 Client module allows for the creation of OAuth2 clients as Drupal plugins, handling all back end functionality for retrieval, refresh, and deletion of tokens.

Quick Guide

Here is a brief overview of how to use this module to manage Oauth2 authorizations in your own module, with links to more detailed documentation on each part of the solution. If this is the first contributed module that you have worked with, there is existing documentation on drupal.org about how to work with composer in general and how to install a module.

  1. Determine your strategy for storing confidential data.
  2. Create an Oauth2Client plugin in your module that extends Oauth2ClientPluginBase.
  3. When your module is created and you browse to /admin/config/system/oauth2-client a configuration entity associated with your plugin is created. Edit and add your credentials.
  4. Save and test
  5. Use the provided Oauth2ClientService to request your needed token.

Extending

Every aspect of the client behavior can be customized and extended.