Skip to content

Opauth on PHP frameworks

Gage Gogan edited this page Jul 7, 2016 · 25 revisions

Opauth works well with other PHP frameworks.

Available Opauth plugins

Requested plugins

  • WordPress
  • Drupal
  • Zend Framework
  • Symfony2 Bundle
  • Slim Framework
  • Phalcon
  • Laravel 5

Edit and add to this list to make a request.

Using vanilla (plain) PHP?

Refer to the example/ in Opauth on how you can implement Opauth on your vanilla PHP project.

Or refer to the wiki for more in-depth details.

Guideline to authoring an Opauth plugin

This article acts as a quick & basic guideline on developing Opauth plugin for other frameworks, eg. CakePHP or WordPress.

The points below are listed not in any sequential orders and only acts as recommendations. Refer to CakePHP-Opauth for reference when in doubt.

  1. Assuming you are developing a plugin for Bar Framework.

  2. Name your GitHub package bar-opauth.
    This ordering, along with Opauth strategy package naming convention, eg. opauth-facebook, shows where Opauth stands when being used together. For insance, bar-opauth and opauth-facebook, when combined together, makes bar-opauth-facebook and shows that Opauth is in the middle, interfacing between Bar Framework and Facebook authentication.

  3. Do not include Opauth package unless absolutely necessary. Submodule it, or even better, include it via Composer.
    You can, then, make a zip package containing the submoduled Opauth core as an easy download for non-Git users.

  4. Do not include Opauth strategies.
    If feasible, include an obvious Strategy/ directory for users to place Opauth strategies.

  5. Your plugin should handle:

    • Loading of Opauth configs, with proper paths set for your plugin.
    • Instantiation of Opauth.
    • Routing of traffic to Opauth.
    • Handling of callback.
    • If possible, validate auth response at plugin level before passing it back to application.
    • Auth response to be passed back to application.
  6. Include instructions, typically a README, on how to install and use your plugin, especially on how to expect auth response.

  7. Announce your creation or your intention at Opauth Google groups.