application that uses OAuth and javascript [closed]

I am planning to create an app that uses JavaScript and it needs to use OAuth to authenticate user for a website. Can anyone help me out please? Any sample code? I know about the Google Code Javascript OAuth library but I am not sure how to implement that..



There is a JS client implementation for OAuth here:

It contains example code to get you running. Basically, what you do is this:

var url = "...";
var accessor = {
  token: "...",
  tokenSecret: "...",
  consumerKey : "...",
  consumerSecret: "..."

var message = {
  action: url,
  method: "GET",
  parameters: {...}

OAuth.completeRequest(message, accessor);        
OAuth.SignatureMethod.sign(message, accessor);
url = url + '?' + OAuth.formEncode(message.parameters);

// send request to 'url'

Cheers, Matthias


The mentioned security problems can be solved via YQL:


I've written a generic OAuth 2.0 javascript library.


If you're writing a Firefox (or other Mozilla) addon, consider oauthorizer. I'm using this for the latest version of lite. However, I did hit some issues getting this approved for the Mozilla Add-Ons site, which I'm currently working through.


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.