It would be awesome if we can use OAuth in JavaScript purely in client side.
before start to do that, please let me explain “OAuth2” with this picture in feeeew word (skip to section 2 YQL if you know OAuth2):
OAuth 2 is widely use as authorize third party application without expose user’s password, OAuth2 using 2 steps verification. Take github as example:
There are 2 role in this story: Developer Oyang
and User Lulu