mod_python OpenID Access Control

Since XRI is pretty much in bed with OpenID and NeuStar is an XRI shop, I get to play around with it quite a bit.

Here’s a little success report about using JanRain‘s mpopenid module to protect certain restricted resources served by Apache. It works somewhat like your basic HTTP authentication, but instead of returning a 401 Authorization Required response causing the browser to prompt for username and password, it redirects you to the OpenID login page. Pretty neat eh?

So, here's how we go about doing it.

My ingredients:

Following the recipes in this README file, I was able to set it up with one caveat: Python ElementTree module is a dependency of the Python Yadis library and you need to first install that.

Did I mention that you could login using an I-name?

UPDATE:

The following patch for mpopenid.py is needed to make i-name login work:

--- mpopenid-1.2.0-pre5/mpopenid.py     Tue Nov 21 20:24:53 2006
+++ mpopenid-1.2.0-pre5-wil/mpopenid.py Sun Jan 14 16:12:16 2007
@@ -157,10 +157,17 @@
         url = s.strip()
         if not url:
             continue
-        parsed = urlparse.urlparse(url)
-        if not (parsed[0] and parsed[1]):
-            url = 'http://' + url
-        urls.append(urinorm(url))
+
+        if (url[0:6].lower() == "xri://"):
+            url = url[6:] # strip "xri://"
+
+        if (url[0] not in "=@!$+"): # doesn't look like an XRI
+            parsed = urlparse.urlparse(url)
+            if not (parsed[0] and parsed[1]):
+                url = 'http://' + url
+            url = urinorm(url)
+
+        urls.append(url)

     return urls


57 Responses to “mod_python OpenID Access Control”

  1. dready blog v2.0 » Blog Archive » This blog is OpenID enabled! Says:

    [...] dready blog v2.0 « mod_python OpenID Access Control [...]

  2. =wil Says:

    This is a test

  3. Does Google use PageRank? No. at 天真:天眞的我们必然幸福 Says:

    [...] 15th, 2007 · Filed: WordPress · OpenID · No Comments · Popularity: 1% # mod_python OpenID Access Control Here’s a little success reportabout using JanRain’s mpopenid module to protect certain restricted resources served by Apache. It works somewhat like your basic HTTP authentication, but instead of returning a 401 Authorization Required response causing the browser to prompt for username and password, it redirects you to the OpenID login page. Pretty neat eh? [...]

  4. http://if20.net/ Says:

    Nice job. I will test it in my PC. Thanks.

  5. http://openid.aol.co Says:

    Every AOL account now has its own openID

    http://journals.aol.com/panzerjohn/abstractioneer

    Trying mine

  6. http-awz.openid.freelogy.org- Says:

    Thanks for the entry. –awz

  7. =gmw Says:

    Thats awesome wil. Can I join the Cult of Wil Worshipers?

  8. wil Says:

    @=gmw You have to first pay $100K to join the FeedWil Foundation first.

  9. infomisa.net» Blog Archive » OpenID "Hello World" on apache still deep magic Says:

    [...] to find a version of python-openid that matched. I almost gave up at that point, but heartened by somebody else who got mpopenid working, I went back to searching and found a launchpad development version of mpopenid. That seems to work [...]

  10. Frank van Soldt Says:

    Hey sweet little mod you made there. Thanks for the entry.

  11. Angela Says:

    I did not expect Canada to be back this year. hopefully this will be their last..

  12. Kay Says:

    The Photo Expo sounds like a great time! : D

  13. автоматы вулкан Says:

    This is the year 2012, quit being so old fashioned. Cheryl is great!

  14. nnn Says:

    The people who have a routine of morning walk can absorb the sunlight. Sunlight of early morning contains the Vitamin D. It means you can get this vitamin without spending money. It is a natural and free source of vitamins. You are suggested to focus on these sources to be healthy. <a href="http://www.cureacnemarks.com” target=”_blank”>www.cureacnemarks.com

  15. pinky Says:

    <a href="http://www.cureacnemarks.com” target=”_blank”>www.cureacnemarks.com The people who have a routine of morning walk can absorb the sunlight. Sunlight of early morning contains the Vitamin D. It means you can get this vitamin without spending money. It is a natural and free source of vitamins. You are suggested to focus on these sources to be healthy.

  16. jackwhite521 Says:

    jackwhite521

    I am really impressed from your immaginative thinking and impressive stated information, i am glad.
    dallas internet marketing consultants.

    marketing agency dallas

  17. Personal Injury Says:

    This is a great test so far as well! I'm pleased to know this type of update and got some special information from this article. I was in the hunt for this type of reading. Thanks the head up and keep posting like this and I wanna try it for my laptop as well………

  18. Concrete Atlanta Says:

    Hello dude, really like this concept. I did not know much more about mod_python OpenID Access Control but the allocation you did here truly makes me knowable about this issue. Thanks

  19. BRETLEE0035 Says:

    This is a terrific article, and I would like more information if you have any. I am fascinated with this topic and your post has been one of the best I have read.
    Raspberry Ketone | Raspberry Ketone

  20. jone smith Says:

    I truly appreciate this blog post.Really looking forward to read more. Great.

    los angeles car dealers.

  21. Lambert Says:

    Thanks for your sharing,I will pay more attentions to your blog. Looking forward to your better and better.

  22. Jeremy Says:

    I agree with your idea competely.I am looking forward to another great article from you.

  23. Harriet Says:

    less or little less jobs, it is good? : D

  24. Atwood Says:

    If you are in the United Kingdom where? By the way,

  25. Lipozene Reviews Says:

    I harmonize with your conclusions and will thirstily look forward to your approaching updates

  26. Lipozene Says:

    Pretty cool post. It’s really very nice and useful post.Thanks for sharing this with us!it’s my first visit.

  27. Sensa Says:

    I am going to subscribe, so I can learn more. I can't wait to receive updates through e-mail.

  28. Slimquick Says:

    Now and then I’ll stumble across a post like this and I’ll recall that there really are still interesting pages on the web. ^_^. Thanks.

  29. Lipozene Says:

    Advantageously, the article is really the best on this notable topic. I harmonize with your conclusions and will thirstily look forward to your approaching updates

  30. Lipozene Says:

    After read a couple of the articles on your website these few days, and I truly like your style of blogging.

  31. webhostingiq Says:

    That makes all the difference! Really good progress. Congratulations.
    website

  32. Узнай больше Says:

    It is very clear that healthcare systems are found under a worst condition now days; as a result people are not able to get better and sufficient health care facilities from various health care organization. Especially in countries like India and in other Asian countries we have encountered

  33. glass Says:

    Really nice "recipe"! Thanks for sharing it. House Window Glass Replacement Austell

  34. patio furniture Says:

    A concrete slab may be used as a base for a patio or shed, or may simply be used to finish a basement floor. No matter what you're using it for, the basic construction of the slab is the same in most residential applications. patio furniture lexington ky

  35. dentist lexington Says:

    Anyone who has to live with missing teeth knows that it is a painful situation. Some people may be born without all of their adult teeth. Others lose teeth from growing older, damage or illness.dentist lexington

  36. lingerie import Says:

    Félicitations pour cette initiative! Les produits sont-ils toujours fabirqués au Québec?

  37. site Says:

    Thanks for sharing this script. Ill let you know how it works with me.

  38. see here Says:

    You have the most helpful tips. Thanks for this code.

  39. jenny Says:

    It's apparent you are dedicated to excellent writing. It is truly related to the main points mentioned in this writing. This is really great original information….and here it is to inform you that sawdagger is Trading marketplace Directory for Manufacturers, Exporters, Suppliers, Telecommunications Importers, Computer Software, Hardware and Peripherals Buyers, Computer Software, Hardware and Peripherals Wholesalers, Sports & Entertainment Traders, Gifts & Crafts Products and Trade Leads.

  40. jake Says:

    good artical on this topic and guys for Jewelry & Watches Manufacturers, Agriculture Exporters, Apparel Retailers, Food & Beverage Distributors log on to sawdagger

  41. camisa polo Says:

    I am really impressed from your immaginative thinking and impressive stated information, i am glad

  42. alice Says:

    This post is very nice. I read this topics is really superb and help for us open id. write my dissertation

  43. Lipozene Says:

    Great site. I add this Post to my bookmarks.

  44. view Says:

    I enjoyed reading this post. Do you have other articles relating to this? I would like to read more about it. Please keep up this amazing blog. I constantly visit it. check credit score for free

  45. Pay for assignment Says:

    I am really impressed from your imaginative thinking and impressive stated information, i am glad. This is great site .

  46. roz mary Says:

    My reasearch work has just came to a conclusion after reading this brilliant masterpiece and i am making a wise decision to share it

    [ where to buy garcinia cambogia ][ garcinia cambogia at gnc ][ garcinia cambogia at walmart ][ garcinia cambogia at walgreens ][ whole body garcinia cambogia where to buy ]

  47. dissertationpalace Says:

    good information about access control :)

  48. SlimQuick Says:

    Amazing article. I am so impressed. Could never think of such a thing is possible with it…I think you have a great knowledge especially while dealings with such subjects.

  49. Lipozene Reviews Says:

    Amazing article. I am so impressed. Could never think of such a thing is possible with it…I think you have a great knowledge especially while dealings with such subjects.

  50. Weight Loss Pills Says:

    I truly like your style of blogging. I tag it to my favorites internet site list and will be checking back soon. Please check out my web site also and let me know what you think.

  51. Lipozene Says:

    I harmonize with your conclusions and will thirstily look forward to your approaching updates

  52. Weight Loss Says:

    Amazing article. I am so impressed. Could never think of such a thing is possible with it…I think you have a great knowledge especially while dealings with such subjects.

  53. www Says:

    This is a very interesting fact. Your blog is becoming very popular because you write quality articles) Thanks!

  54. SlimQuick Says:

    I truly like your style of blogging. I tag it to my favorites internet site list and will be checking back soon. Please check out my web site also and let me know what you think.

  55. Walmart Lipozene Says:

    Your article is very good very practical, I will collect up, hope you can also pay attention to my web site, thank you very much!

  56. udin Says:

    I've learn all the posts and i discovered very unique information on this weblog good work by your aspect thanks to your herbalife diet views these are very useful for individuals who don’t know as a lot every time i wanna share or discuss something i surely come back and focus on on this blog.

  57. herbalife diet Says:

    I've learn all the posts and i discovered very unique information on this weblog good work by your aspect thanks to your views these are very useful for individuals who don’t know as a lot every time i wanna share or discuss something i surely come back and focus on on this blog.