Tuesday, 22nd January, 2008
Using Yahoo BBAuth with Django
Today I tried Yahoo's Browser based authentication service.
Yahoo BBAuth also offers a Single Sign-On (SSO) facility so that existing Yahoo! users can use your services without having to complete yet another registration process.
To enable Yahoo SSO in your application all you need to do is register your application, download this quick start package and integrate it with your application.
I tried integrating with Django and it was pretty easy.
Download Yahoo BBAuth python classes here
Extract ybrowserauth.py in your django project directory
Create a bbauth_config.py file into your root project directory
Add the following lines, replacing it with your appid and secret
# Put your Application ID and Secret hereAPPID = ‘5KzQuKHIkxxxxxxxxxxxxxxxxxxSztLwiAF7SECRET = ‘0e68e582xxxxxxxxxxxxxxxxxxxx0f25f4In your views.py file add the following import statement.
from mysite import ybrowserauth, bbauth_configNow assuming that I want to protect my photos view with YAHOO BBAuth I will add the following code in my photos view
def photos(self, ts, sig, token, userhas, appdata)# Instantiate the class cptr = ybrowserauth.YBrowserAuth(APPID, SECRET, ts, sig, token, userhash, appdata) if token == None: # If no token is found, create the authentication URL and display it req.content_type = "text/html" outstuff = cptr.getAuthURL('someappdata', 1) from django.http import HttpResponseRedirect #this will redirect to YAHOO login page return HttpResponseRedirect(outstuff) else: # If a token is found, it must be Yahoo!'s bbauth coming back as the # "success" URL. So, we validate the signature and do all the work request_uri = req.parsed_uri[6]+ '?' + req.parsed_uri[7] cptr.validate_sig(ts, sig, request_uri) userhash = cptr.userhash appdata = cptr.appdata cookie = cptr.cookie token = cptr.token wssid = cptr.wssid # Your photos view definition goes followsUse example bbatestMAIL.py and bbatestPHOTOS.py file that comes with the sample code
A php example can be found at Dan's Blog


Love was the only one who stayed. Love wanted to hold out until the last possible moment.
When the island had almost sunk, Love decided to ask for help.
Richness was passing by Love in a grand boat. Love said,
"Richness, can you take me with you?"
To change the world
Through every life you touched.
You sparked the creativity
In the students whom you taught,
And helped them strive for goals
That could not be bought,
You are such a special teacher
That no words can truly tell
However much you're valued
For the work you do so well.
Customization of Jackets are started to give wearer an exclusive fit. You can design your own shirt considering the comfort level.
dealer looks after like Tag Heuer, Cartier or Omega are throughout the world renowned for his / her exceptional qualities, too as for his / her really outstanding cost tag. circular the years
They are always in experimenting mood with their wardrobes to look awesome and unique. After all who don’t want to look good?
The real truth that the number of them purchased great signature purse does not imply its a wonderful item of work, but at situations it does imply that individuals will give considered to it to become one and consequently most maybe obtain it
If you recently received an invitation to a wedding that read "formal attire requested," and it left you scratching your head in wonderment, don't worry. In today's typically casual world, it can be difficult to determine what counts as "formal" and what doesn't.
.To complete the Four-In-Hand-Place the tie around the back of your neck with the skinny end hanging on one shoulder and the thicker end on the other shoulder. Make sure the underside of the tie, the side with the label, is facing your shirt and not the outside world.Slide the tie to adjust the length of the skinny end by making it longer or shorter, depending on the size of your neck.
First off, let me say that I've owned several Military Issue A-2 Bomber Jackets, so I have a pretty good idea of how this compares the original. The color is very close, if not, slightly darker than some of the originals out there (Avirex, Cooper, etc..). The best way to describe it is that it's 'chocolate' in color. Pretty dark, but nice. The sewing is tight and the leather seems to be nice quality as well. I have no idea what others were saying about the leather being thin. This is not thin for an A-2 Jacket, and actually thicker than the first original horsehide A-2 that I owned.
Comfortable, soft and warm this Solaris Parka is. The color is wonderful for the coming Christmas and New Year! Also the pice is reasonable one.
top quality product that is certainly certainly not been recently suited for a new hockey footwear ahead of.
To view a range of fashionable footwear including the latest El Naturalista collection, visit the Sarenza website.
I just received my chilliwack parka by post having ordered it online. I thought that I had researched my size correctly (42 Europe) but the medium is a bit snug, therefore my advice is not to buy it online and try it on before you purchase it. also remember it is very waisted so if it is very cold your legs will feel it. finally for this price i'm not convinced it is good value.
The reasoning is simple, different styles are designed to fit certain body types and achieve different looks. An extreme example of this is the skinny jean, designed for men of with a slight build interested in a trendy look. Lesser known, but with a wider appeal
i help maintain the fitness level of 6 high level dressage horses in the winter. there is lots of standing around outside or in barns. this coat has made the work so much more tolerable. i am so toasty now. my only regret, is that i didn't buy it earlier in the season
If I'm not instrested in BBAuth ,Is there any way to access Yahoo ,alike Client Login in Google .
I need an BBAUtH SUCCESS URL (ex. httpp://domain.com/path/to/web/app')
You are right. BBAuth only returns a hash, which can be used to identify a returning user. But this is more then Google at the moment offers. Sad but true. And so I have to stick to Google ClientLogin so far. At least for the development phase of my project.
The problem with Google Auth is, that using AuthSub (preferable over ClientLogin) can be used for simple webpages, but you can't use the Google ID for storing data in your web application. In contrast Yahoo supports the retrieval of the user id. But hopefully Google will add this too.\r
\r
And thanks for the Yahoo! code :)
AFAIK, Yahoo do not give user id, but just give user hash which is unique to each user. There is no way to get the actual user ID, correct me if I am wrong.
have you tried integrating Google Auth in django apps ? or can you write about it ?
Excellent Start! Good Luck....
@json
\rI haven't tried Google Auth API yet. You can find detailed documentation at Google Auth for web applications.