Enable OAuth2 #160
Sure, I have some real example code but it might take me a while to clean it up.
auth(:oauth2, :token_class => 'AccessToken')
trivial example, everyone has permission for /api/people
Hi @dblock, I've integrated Grape and Doorkeeper (OAuth 2 Provider). Here is how I did: OAuth 2.0 Tutorial: Protect Grape API with Doorkeeper, and also a step-by-step sample repository chitsaou/oauth2-api-sample.
Hope it can help you.
BTW may I put the link in Wiki?
@chitsaou , @dblock , i've authored a gem named WineBouncer to protect your precious Grapes from unauthorised requests. It can offer a more up to date protection of your Grape API with Doorkeeper. It also offers grape-swagger syntax like authorization (compliant with swagger spec) so you can use Oauth2 in your swagger documentation without modifications. I was hoping what you guys think of this implementation and maybe give some feedback.