This package will help you to accomplish oauth 2 even in phonegap.