Home > Uncategorized > oAuth CosumerKey and SecretKey for Google,Twitter,Yahoo and Vimeo

oAuth CosumerKey and SecretKey for Google,Twitter,Yahoo and Vimeo

Here are a list of oAuth providers, for Google, Twitter, Yahoo and Vimeo, with consumerKey and SecretKey set for http://Localhost, so they are ideal for testing, although you’ll need to get live ones for live environments:

 

if (Request.PathInfo == “/requestToken/google/”)
{
consumerKey = “anonymous”;
consumerSecret = “anonymous”;
// Google requires an additional “scope” parameter that identifies one of the google applications
requestTokenEndpoint = “https://www.google.com/accounts/OAuthGetRequestToken?scope=https://www.googleapis.com/auth/userinfo#email”;
requestTokenCallback = GetRouteableUrlFromRelativeUrl(“oAuth/default.aspx/authorizeToken/google/”);
authorizeTokenUrl = “https://www.google.com/accounts/OAuthAuthorizeToken”;
}
else if (Request.PathInfo == “/requestToken/twitter/”)
{
// http://twitter.com/oauth_clients/details/763647
consumerKey = “esK3OieltAXufhxvWJBNw”;
consumerSecret = “8APVHgYEXwDoPgtsUj7tYns4NFNkOnXG5yMAPAPUXU”;
requestTokenEndpoint = “https://api.twitter.com/oauth/request_token”;
requestTokenCallback = GetRouteableUrlFromRelativeUrl(“oAuth/default.aspx/authorizeToken/twitter/”);
authorizeTokenUrl = “https://api.twitter.com/oauth/authorize”;
}
else if (Request.PathInfo == “/requestToken/yahoo/”)
{
//https://developer.apps.yahoo.com/dashboard/createKey.html
consumerKey = “dj0yJmk9QVM4UjFabHZrME4zJmQ9WVdrOVRYbERhMVJSTTJVbWNHbzlOVFF5T0RJeU5UWXkmcz1jb25zdW1lcnNlY3JldCZ4PWJh”;
consumerSecret = “3d9ec8bea068a2bdd5b940b24fbedc9da6949569”;
requestTokenEndpoint = “https://api.login.yahoo.com/oauth/v2/get_request_token”;
requestTokenCallback = GetRouteableUrlFromRelativeUrl(“oAuth/default.aspx/authorizeToken/yahoo/”);
authorizeTokenUrl = “https://api.login.yahoo.com/oauth/v2/request_auth”;
}
else if (Request.PathInfo == “/requestToken/vimeo/”)
{
// http://vimeo.com/api/applications/new
consumerKey = “7a4b3b5d5205e6c6903bf77aeaf258cc”;
consumerSecret = “23609bc1174ca5c5”;
requestTokenEndpoint = “http://vimeo.com/oauth/request_token”;
requestTokenCallback = GetRouteableUrlFromRelativeUrl(“oAuth/default.aspx/authorizeToken/vimeo/”);
authorizeTokenUrl = “http://vimeo.com/oauth/authorize”;
}

 

Once the oAuth token is acquired, then you can get email address information from Google using:

oAuthConsumer.GetUserInfo(“https://www.googleapis.com/userinfo/email”, realm, consumerKey, consumerSecret, accessToken.Token, accessToken.TokenSecret);

And, significantly more information from Twitter using:

oAuthConsumer.GetUserInfo(“http://api.twitter.com/1/account/verify_credentials.xml”, realm, consumerKey, consumerSecret, accessToken.Token, accessToken.TokenSecret)

Please post updates to this post if you find equivalents for Yahoo!, or Vimeo. I’ve also heard about Messenger Connect which is supposed to be an oAuth system for Microsoft…

 

 

Advertisements
Categories: Uncategorized
  1. May 22, 2012 at 2:19 pm

    Thanks alot!

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: