Dav Glass![]()
This simple oAuth module will allow you to create a signed url to use with a 2-Legged oAuth web service.
It also modifies YQL, if it's on the page, and adds in support for key and secret config options.
Please don't use this key in your web app, it's only here for the example.
<script src="http://yui.yahooapis.com/3.1.2/build/yui/yui-min.js"></script>YUI({
//Last Gallery Build of this module
gallery: 'gallery-2012.11.09-01-41'
}).use('gallery-oauth', function(Y) {
//Make sure the oAuth libs are available on the page
Y.oAuth.ready(function() {
//Using with YQL
Y.YQL('select title,abstract from search.news where query="election"', function() {
console.log('success: ', arguments);
}, {
key: 'dj0yJmk9Q9WVdrOVJGSlJRelpHTlRJbWNHbzlNelF6TlRjMk9EWXkmcz1jb25zdW1lcnNlY3JldCZ4PWMw',
secret: 'f6cbasdfsadfas68d25da294a584b541ff29da599a3f53db76',
base: '://query.yahooapis.com/v1/yql?'
});
//Using with JSONP
Y.jsonp('mywebservice.com/?', {
on: {
success: function() {
console.log('success: ', arguments);
}
},
format: function(url, proxy) {
var finalURL = url + 'callback=' + proxy;
return Y.oAuth.signURL("dj0yJmk9SXNaaTF2JGSlJRelpHTlRJbWNHbzlNelF6TlRjMk9EWXkmcz1jb25zdW1lcnNlY3JldCZ4PWMw", "5da294a584b5asdfasd41ff29da599a3f53db76", finalURL);
}
});
});
});| Subject | Author | Date |
|---|---|---|
| General oAuth Concepts - Web page authentication | Mark | 10/19/10 |
| Re: General oAuth Concepts - Web page authentication | Dav Glass | 10/19/10 |
| Re: General oAuth Concepts - Web page authentication | Mark | 10/19/10 |
| YQL 2-Legged oAuth 502 Bad Gateway for sha1.js | Roman Stachura | 10/28/10 |
| Re: YQL 2-Legged oAuth 502 Bad Gateway for sha1.js | Dav Glass | 10/28/10 |
| Doing POST requests with OAuth | Jeremy Baker | 09/24/12 |
| Re: Doing POST requests with OAuth | Dav Glass | 09/24/12 |
| Re: Doing POST requests with OAuth | Jeremy Baker | 09/24/12 |
| Re: Doing POST requests with OAuth | Dav Glass | 09/24/12 |
| Re: Doing POST requests with OAuth | Jeremy Baker | 09/24/12 |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info