2013年10月9日星期三

Lorna Mitchell: OAuth Middleware for Slim


Lorna Mitchell has posted about some middleware for the popular Slim (micro)framework that helps with OAuth functionality.



OAuth can be anything you want it to be, the standards are lax and give you plenty of room for getting the right implementation for your system. However you proceed, though, you'll need to check an access token on every request - and in a Slim application, a middleware can help enormously since it hooks in to every request by design. I've recently implemented this and thought I would share.


She's created a basic middleware component that can be easily dropped into the framework to handle the checking of the tokens via an "AuthService" object. She also includes a brief snippet of how she generates the codes, combining the output of bin2hex and openssl_random_pseudo_bytes.


Link: http://www.lornajane.net/posts/2013/oauth-middleware-for-slim

没有评论:

发表评论