Download the PHP package muffin/oauth2 without Composer
On this page you can find all versions of the php package muffin/oauth2. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download muffin/oauth2
More information about muffin/oauth2
Files in muffin/oauth2
Package oauth2
Short Description CakePHP 3 authentication using the league/oauth2-client family
License MIT
Homepage https://github.com/usemuffin/oauth2
Informations about the package oauth2
OAuth2
CakePHP 3 authentication using the league/oauth2-client.
Install
Using Composer:
You then need to load the plugin.
Wait, you're not done yet. This plugin will NOT require any of the clients. You will have to do it yourself. For e.g. if you want to use Github client do:
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) 2018, Use Muffin and licensed under The MIT License.