From 9e2955c386b0a1860f8a9cd1a336a8a6c04a452e Mon Sep 17 00:00:00 2001 From: Thom Seddon Date: Sun, 12 Feb 2012 21:17:40 +0000 Subject: [PATCH] Added README --- README.markdown | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 README.markdown diff --git a/README.markdown b/README.markdown new file mode 100644 index 0000000..616e027 --- /dev/null +++ b/README.markdown @@ -0,0 +1,42 @@ +# CakePHP OAuth2 Server Plugin + +This is a plugin for implementing an OAuth Server/Provider in CakePHP, built on quizlets [oauth2-php library][1] + +## What's inside +* A lovely OAuth component that allows cakey access to the oauth library +* The required models with super safe automatic beforeSave token hashing +* AuthComponent'ish interface for action allow/deny's +* Convenience functions for retrieving the current user and adding clients +* An example controller with authorize and token end points + +## Requirements +[CakePHP 2.0.x](http://cakephp.org/) + +A clone of [oauth2-php][1] in your Vendors folder + +## Installation +First grab the tables.sql and get your tables going. + +Then clone this repo into a "OAuth" folder in your Plugins folder: +`$ git clone git://github.com/seddonmedia/cakephp-oauth-server.git Plugin/OAuth` + +And include the component in your controller: +`$components = array('OAuth.OAuth');` + +## Configuration +If you don't use the Users model with username+password fields for authentication you should specify the correct model and fields to be used to validate users like so: +`$this->OAuth->authenticate = array('userModel' => 'Members', 'fields' => array('username' => 'email'));` + +You will need to allow/deny access to actions: +`$this->OAuth->allow(array('userinfo'));` + +If you want to use the example controller straight off the bat, routes are included to give you sexy URL's like: "/oauth/token". +You can load this route from your bootstrap like so: +`CakePlugin::loadAll(array( + 'OAuth' => array('routes' => true) +));` + +There is quite a bit of documentation through the code, so dive in, get your hands dirty and submit any issues here! + + +[1]: https://github.com/quizlet/oauth2-php \ No newline at end of file