Download the PHP package andres-ml/cakephp-oauth2 without Composer
On this page you can find all versions of the php package andres-ml/cakephp-oauth2. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download andres-ml/cakephp-oauth2
More information about andres-ml/cakephp-oauth2
Files in andres-ml/cakephp-oauth2
Package cakephp-oauth2
Short Description CakePHP 3.6 authentication using the league/oauth2-client family
License MIT
Homepage https://github.com/usemuffin/oauth2
Informations about the package cakephp-oauth2
OAuth2
CakePHP 3 authentication using the league/oauth2-client.
Install
Using Composer:
You then need to load the plugin. You can use the shell command:
or by manually adding statement shown below to bootstrap.php
:
Wait, you're not done yet. This plugin will NOT require any of the clients. You will have to do it yourself:
Usage
First, start by defining the providers:
Upon successful authorization, and if the user has no local instance, an event (Muffin/OAuth2.newUser
)
is triggered. Use it to create a user like so:
Finally, once token is received, the Muffin/OAuth2.afterIdentify
event is triggered. Use this to update your local
tokens for example:
Next up, you need to create a route that will be used by all providers:
Now, if you have already read the book's AuthComponent
documentation, you should be familiar with how to
add the new authentication object to it:
Patches & Features
- Fork
- Mod, fix
- Test - this is important, so it's not unintentionally broken
- Commit - do not mess with license, todo, version, etc. (if you do change any, bump them into commits of their own that I can ignore when I pull)
- Pull request - bonus point for topic branches
To ensure your PRs are considered for upstream, you MUST follow the CakePHP coding standards.
Bugs & Feedback
http://github.com/usemuffin/oauth2/issues
License
Copyright (c) 2015, Use Muffin and licensed under The MIT License.