Skip to content

Instantly share code, notes, and snippets.

@julien-c
Created June 13, 2013 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julien-c/5775253 to your computer and use it in GitHub Desktop.
Save julien-c/5775253 to your computer and use it in GitHub Desktop.
<?php
Route::post('oauth/token', function() {
$oauth = new OAuth2\Provider();
return $oauth->tokenRequest();
});
Route::filter('oauth', function() {
$oauth = new OAuth2\Provider();
return $oauth->filter();
});
Route::filter('optionalAuth', function() {
$oauth = new OAuth2\Provider();
$oauth->verifyAccess();
});
Route::group(array('before' => 'oauth'), function() {
Route::get('private', function() {
return Response::json(['private' => 'stuff']);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment