Does Google Apps Script support signed OAuth requests? - oauth

OAuth wants requests for "protected resources" to be signed by the consumer using a hash such as HMAC-SHA1 or RSA-SHA1.
Does Google Apps Script support request hashing? I RTFM, and tried the demo (https://developers.google.com/apps-script/articles/twitter_tutorial) but... no joy.
Thanks in advance!

Try Utilities.computeDigest() Utilities.computeHmacSignature() and Utilities.computeHmacSha256Signature()
Documentation at https://developers.google.com/apps-script/service_utilities

Related

HTTP post request with OAuth1 through UrlFetchApp in Google App script

I have a problem signing an HTTP post request with the UrlFetchApp in Google App scripts. I only need to sign the request with my consumerKey, I do not need complete authorization with callback and everything. How would I be able to sign the request using OAuth encoding? Do I simply add the OAuth as parameters or as headers? I am very new to this and would appreciate any advice.
Thanks
Here is an Update on the situation: Google just added 2-legged support to their OAuth1 library. See https://github.com/googlesamples/apps-script-oauth1.
If you are using Google App Script and that library, update it to version 11.
I simply changed the access token in the example to empty string. Now everything works just fine.
Thanks!

Force expiring OpenStack Swift Tokens

Is there a way to force expire or revoke OpenStack Swift Tokens? I am looking some API method to do this.
Bing / Google search didn't return anything useful.
In swauth (after version 1.0.7), try to include "X-Auth-New-Token: true" in http header. And then swauth will issue a new token and revoke any old token.

Is SSL required to use the google plus api?

Im fairly new to Oauth2.0.
I wanted to start using the Google Plus api.
I used the following resources
"Using OAuth 2.0 to Access Google APIs" documentation.
Google Plus Oauth Api scope key
(https://www.googleapis.com/auth/plus.me).
After playing with curl and having success with other "scope keys" . I encountered the following error with the google plus scope (https://www.googleapis.com/auth/plus.me).
"Token invalid - AuthSub token has wrong scope"
Then i found the solution Google’s OAuth Pain: Token invalid – AuthSub token has wrong scope
It pointed out the following:
if you’re getting a “Token Invalid – AuthSub token has wrong scope”
error when you’re trying to use OAuth (or even AuthSub for that
matter?), make sure the scope you’re requesting is using the same
protocol as you’re using
I did what he said , took the "s" off the scope "
http://www.googleapis.com/auth/plus.me
But now it gives me this error
Does this mean that your site MUST use SSL?
Thanks for the feedback.
EDIT: Turns out i was using the wrong api
Should be https://www.googleapis.com/plus/v1/people/me?access_token=xxxx
Your site doesn't need to use SSL but all calls it makes to the Google+ API must use HTTPS. See: http://developers.google.com/+/api/oauth for more information about OAuth scopes in Google+
I found the answer, i was using the wrong url for the api
https://www.googleapis.com/plus/v1/people/me?access_token={hash}

some errors when i try to use scribe java library for yahoo authentication

When I tried connecting to Yahoo via Oauth authentication using scribe java library, I get the error message "oauth_problem=consumer_key_rejected" I tried different sets of API keys but same error message is shown...How do I fix this?
Check with Yahoo for your application consumer key, otherwise you can ask to renew a new consumer key.

Flickr oAuth signing requests

Flickr started to support oAuth just few weeks ago and there is no up to date documentation.. I was able to pass oAuth authentication process but I am unable to upload a photo through API.
I am supposed to sign all parameters except photo parameter. This is my signature base:
POST&http%3A%2F%2Fapi.flickr.com%2Fservices%2Fupload%2F&oauth_consumer_key%3D...6b%26oauth_nonce%3D90660%26oauth_signature_method%3DHMAC-HA1%26oauth_timestamp%3D1309888296%26oauth_token%3D72157626975786735-ed7eccb40ffcc69e%26oauth_version%3D1.0d
And I use "consumer_secret&token_secret" to sign it.
It's all written in AS3 with oAuth library but I think it doesn't matter. The response I get is:
"Invalid API Key (Key has invalid format)"
I don't think there is a problem with API key..
Any suggestions guys??
Thanks
It looks like you're using the incorrect Path. The latest Oauth docs are here:
http://www.flickr.com/services/api/auth.oauth.html
you can learn more about signing requests here:
http://hueniverse.com/2008/10/beginners-guide-to-oauth-part-iv-signing-requests/
and I'm not sure what language you're using but here is an example in Ruby:
https://gist.github.com/383159
and Python:
http://web.archive.org/web/20120919234615/http://mkelsey.com/2011/07/03/Flickr-oAuth-Python-Example.html

Resources