366

Product support

Visit this product's website for support.

Categories

Authentication Provider for OctoberCMS

Introduction

This plugin provides authentication to the RESTful plugin nodes. This means that you can now secure the API nodes written using the Rest plugin using this plugin. You will need to install other plugins for specific auth mechanisms. For example, OAuth2.

Configuration

You need to configure the API from the OctoberCMS backend in the Settings page (System > API Configuration).

Coming Soon

  • Basic authentication support directly provided in this plugin rather than a separate one. Only
  • RainLab.User plugin support for better token management as well as support for using username than email for authentication.
  • Auth configuration tab in Settings to manage the auth configuration.
  • Mobile plugin support to allow instance-level token issue, singleton tokens, and other cool features.

Ideally, you can use the OAuth2 mechanism provided by the OAuth plugin. However, you can implement any authentication scheme simply by coding your own plugin as well. You merely need to write the middleware for the auth mechanism and this plugin will do the rest.

Adding an Auth Provider

You can add an auth provider simply by writing a registerAuthMechanisms method in your Plugin.php like this:

    public function registerAuthMechanisms()
    {
        return [
            'oauth2' => [
              'name'     => 'OAuth 2',
              'callback' => function ($request, $next) {
                  // Code to handle the auth request...
                  return OAuth2ServiceProvider::handle($request, $next);
              }
            ]
        ];
    }
1.0.1

First version of Auth

Oct 11, 2019