OAuth best practices

148 views
Skip to first unread message

robot

unread,
Jun 15, 2012, 4:38:31 PM6/15/12
to res...@googlegroups.com
Sorry in advance if this is a noob question.

I'd like to secure my rest api with OAuth2 or something like it.  That means each rest call needs to check the auth token.  I would think something like server.pre() could be used for that, otherwise every call needs to interrogate headers, query params, or body for it separately.  However, since none of the plugins are run until after routing, this won't work by default.

What are best practices here?  Can I call the plugins manually to parse the request?

-Robot

robot

unread,
Jun 15, 2012, 5:01:19 PM6/15/12
to res...@googlegroups.com
Well, looks like server.use() works, dunno why I didn't try that first.  Told you it was a noob question.

-Robot

Mark Cavage

unread,
Jun 15, 2012, 5:12:11 PM6/15/12
to res...@googlegroups.com
Hi Shane,

Yep - that's how you'd do this. Note the authorization parser only
parses the header, it leaves it to you to do something with it.
There's been a bunch of interest in this - it's somewhere on my list
to just first class this in restify, but not top of the list :\

m

robot

unread,
Jun 15, 2012, 5:47:54 PM6/15/12
to res...@googlegroups.com
There's been a bunch of interest in this - it's somewhere on my list to just first class this in restify, but not top of the list :\ 

I appreciate that... I'm sure you have 9 octrillion things on your plate.  However, I'd like to put in a vote to move up the priority.  Just like your attention to detail on things like making versioning a first class feature, OAuth2 support would add significant value.

Thanks for a great resource.

-Robot 

Gerald Yeo

unread,
Mar 2, 2013, 11:05:07 PM3/2/13
to res...@googlegroups.com
Hi Robot,

I'm also trying to use Restify to create a RESTful server and securing it with oauth2. Can you help me shed some light on how you create a plugin to do that?

Gerald

opensas opensas

unread,
Mar 19, 2013, 9:35:53 AM3/19/13
to res...@googlegroups.com
+1 on this feature (too bad github doesn't allow you to vote for features)
Reply all
Reply to author
Forward
0 new messages