2-legged vs. 3-legged OAuth

From emails I receive it seems like there is a bit of confusion about what the terms 2-legged OAuth and 3-legged OAuth mean. I hope I can clear up this confusion with this article (and don’t contribute more to the confusion…).
In short, they describe two different usage scenarios of OAuth involving two respectively three parties.
3-legged OAuth describes the scenario for which OAuth was originally developed: a resource owner wants to give a client access to a server without sharing his credentials (i.e. username/password). A typical example is a user (resource owner) who wants to give a third-party application (client) access to his Twitter account (server).
On a conceptual level it works in the following way:
Client has signed up to the server and got his client credentials (also known as “consumer key and secret”) ahead of time
User wants to give the client access to his protected resources on the server
Client retrieves the temporary credentials (also known as “request token”) from the server
Client redirects the resource owner to the server
Resource owner grants the client access to his protected resources on the server
Server redirects the user back to the client
Client uses the temporary credentials to retrieve the token credentials (also known as “access token”) from the server
Client uses the token credentials to access the protected resources on the server
2-legged OAuth , on the other hand, describes a typical client-server scenario, without any user involvement. An example for such a scenario could be a local Twitter client application accessing your Twitter account.
On a conceptual level 2-legged OAuth simply consists of the first and last steps of 3-legged OAuth:
Client has signed up to the server and got his client credentials (also known as “consumer key and secret”)
Client uses his client credentials (and empty token credentials) to access the protected resources on the server
Above I used Twitter as an example, though strictly speaking, they don’t use 2-legged OAuth, but a variant of it. They not only provide the client credentials but also the token credentials (see also Using one access token with OAuth ).
As you have seen, 2-legged OAuth is nothing new, it is simply using OAuth in a different scenario than it was designed for. And hence you can use (almost?) all existing OAuth libraries for 2-legged OAuth, too.

The internet weighs the same as a strawberry

Last week, we learned that a fully loaded Amazon Kindle weighs more than a brand new, unused and empty one. This week’s revelation on the same theme is that the internet, in all its infinite glory, weighs about the same as a strawberry. Confused? Excellent.


The internet.

Professor John Kubiatowicz, of the University of California, Berkeley, explained his observation about the Kindle last week, drawing on Einstein’s E=mc² equation, which establishes mass and energy equivalence. He noted that a Kindle stores data by trapping electrons; when a book is downloaded to the Kindle, the number of electrons stays the same, but the energy needed to store the data increases.

As the electrons gain energy, they gain mass, as Einstein’s equation tells us. Armed with this knowledge, the Professor calculated that a fully-loaded 4GB Kindle would weigh a billionth of a billionth of a gram (also known as one attogram, 1ag or 0.000000000000000001g) more than a brand new one.

Building on this further, the clever chaps at YouTube channel vsauce have thrown together a bunch of calculations, that boil down to their conclusion that the internet in its entirety – that’s all of the electrons on all of the servers in all nations across the globe – is made up of a sum total of 50 grams of electrons in motion.

Rather than tax my simple, feeble mind by trying to explain this to you further – the blind leading the blind will get no-one anywhere fast here – check out the video below for an easy-to-digest explanation of Professor Kubiatowicz’s and vsauce’s calculations.

So there we have it: the internet is roughly equivalent in weight to a strawberry. There’s definitely a joke to be made about internet traffic jams here, but perhaps it’s best to avoid that temptation.
Image source: Thundafunda

14 Unusual Websites To Kill Time With When Bored

How is the world on the other side you bored go-getters? I know that a time can come when you just don’t know what else to do? There comes a time in life when you just don’t want to go offline because you are addicted to the internet but you don’t know what to do because you seem to have surfed almost all of it. If you are still reading this then I am assuming that you are someone who will give up on their youth if not shown a way..err..to kill their precious time. Worry not. I will introduce you to some of the most amazing websites that provide a quick cure to boredom.

14 Unusual Websites To Kill Time With When Bored

Neave

Paul Neave seems to have worked hard to come up with his share of amazing flash websites which is a collection of unique flash games to keep you engrossed.

Papervision3D

Tickle the fishes and they run away. Enjoy the under water life in this flash-based website and remember to tickle the shark out there. You might not get such a chance in real life.

Bio-Bak

One of the most bizarre ideas that could have hit a web designer. This website is the result of lots of hard work and planning. For you it will surely be fun and nice way to kill time.

Donnie Darko

You must have seen plenty of movie websites but none would have been planned the way this one was. The website is full of mysterious stuff and attracts the visitor. Though you might find it a bit slow when compared to the rest in this list but I guess that the movie was also mysterious and slow!

Google Gravity

This website does not have much to have fun with but it must be visited once. Especially those who always wanted Google to fall once. See your dream come true, almost!

Ball Droppings

Ball Droppings is an unusually engrossing flash-based game where you get to save lot of balls that keep popping up. I was lost in the website for almost 15 minutes when I realized that I have to wrap up this list.

Bank of Imagination

Bank of Imagination is a unique flash website where one can leave his/her own idea of what the world could be or anything else. Really, check the portal to see what all the world is imagining.

Salt Films

Salt Films had their website full of salt and still it tastes delicious. The creative animation and plenty of options will keep you busy for long.

Forgotten Bookmarks

Forgotten Bookmarks isn’t one of those flash-based web games but it surely has enough to keep you engrossed. See how far human imagination can go when it comes to designing bookmarks.

Bean Crusher

Did you ever think that crushing beans could be fun? Well, it will be once you visit this flash-based website. These beans will surely become tough to hit once you start moving ahead in-game.

Why Do You Stay Up So Late?

The question is obvious. Why do you stay up so late? The flash-based website is a blend of poetry and flash animation. Something that makes you fall in love with it.

The Infinite Oz

You know, I had this website open for almost an hour and it kept showing something or other that was of interest. The flash, the planning and the execution of this website is by far the best I have seen till now. Surreal.

Neon Bible

The interactive video can be attractive and might just catch you staring at it for long. Be warned!

Incredibox

Bored? How about you launch your own band. I mean, just for fun and just for sometime you surely can enjoy your own band. Right?

Conclusion

As a wrap-up, let me warn you that internet is full of stuff that can be interesting but of no use. These websites can be good for sometime but don’t spoil the important things that matter to you the most just because you were lost in these weirdly amazing websites.

Tech Support Base

Computer benchmark applications company Future mark today announced that it has commenced development of a standard gaming performance benchmark for Android tablets. The company aims to launch 3DMark for Android next year, with the aim to measure gaming performance on Android tablets via rendering, CPU and physics tests. Users will be able to compare results of the benchmark between devices, and the results will also be comparable with 3DMark for Windows 8. Futuremark is currently inviting technology companies to join its Benchmark Development Program as a means of shaping the specifications for the initiative. Jukka Makinen, CEO of Futuremark, explained, “Since 1998, the PC industry has relied on 3DMark to accurately measure gaming hardware performance.” “In 2012 we will bring 3DMark to the Android platform with a professional grade benchmark that can be trusted by manufacturers, suppliers and vendors to provide the definitive measure of gaming performance on Android while showcasing the very best in real-time graphics and effects.”

Melvyn Johnson please: How do I download or transfer my google photos AND delete those that I don’t want to keep or share. I can’t find a delete button anywhere, nor a send option to a folder, disk, or flash drive. Help. 20 Aug 2013

Single sign On Service

I’ve been asked a few times to give sample code on SSO (single sign on) services.

But because the code, is sectioned to the services running within the IP / Host then this is the example;

Within your script or software you can redirect pre-approved users to – User Web Application — by signing the request with your API key. The remote authorization url looks like this:

https://yourcompany.com/api/auth?email=user@email.com&timestamp=20110310120000&hash=a94a8fe5cc

Let’s break this url to parts:

https://yourcompany.com/ – this is your url
api/auth – this is the remote authorization path

?email= – the e-mail parameter specifies the pre-approved users that will be logged in
&timestamp= – the timestamp parameter is the current date and time in the following format

“yyMMddhhmmss”; for example November 22nd, 2011 08:10:00pm would be “110310201000”

&hash= – the e-mail, timestamp and your api key concatenated in this order and then hashed with SHA1

Here’s a sample code for ASP.NET in C#:
string apiKey = “myAPIkey-goes-here”;
string email = “someuser@somedomain.com”;
string timestamp = DateTime.Now.ToString(“yyMMddhhmmss”);
SHA1Managed sha1 = new SHA1Managed();
byte[] paramBytes = Encoding.UTF8.GetBytes(email + timestamp + apiKey);
byte[] hashBytes = sha1.ComputeHash(paramBytes);
string hash = BitConverter.ToString(hashBytes).Replace(“-“, “”).ToLower();

Response.Redirect(
string.Format(“https://yourcompany.com/api/auth?email={0}&timestamp={1}&hash={2}”,
email, timestamp, hash));