<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Netvivs</title>
	<atom:link href="http://www.netvivs.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.netvivs.com</link>
	<description>Web Design &#38; Development Blog</description>
	<lastBuildDate>Sat, 28 Apr 2012 22:43:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Pinterest slow, really slow</title>
		<link>http://www.netvivs.com/pinterest-slow/</link>
		<comments>http://www.netvivs.com/pinterest-slow/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 22:43:02 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Articles]]></category>

		<guid isPermaLink="false">http://www.netvivs.com/?p=1760</guid>
		<description><![CDATA[<a href="http://www.netvivs.com/pinterest-slow/"><img align="left" hspace="5" width="150" height="150" src="http://www.netvivs.com/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a><p>I have been digging into Pinterest since its inception and can understand it rapidly gained millions and millions of new users who use this new social network daily. But despite it is based in Amazon EC2 for scalability, sometimes it &#8230; <a href="http://www.netvivs.com/pinterest-slow/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>I have been digging into Pinterest since its inception and can understand it rapidly gained millions and millions of new users who use this new social network daily. But despite it is based in Amazon EC2 for scalability, sometimes it seems that <strong>Pinterest is getting too slow</strong>.</p>
<p>That usually happens when you try to Pin or Repin something and you need to wait a few seconds, more than the affordable human threshold to get the confirmation page.</p>
<p>My question is, does Pinterest ever move really slow? Or it is just me?</p>
<p><map name='google_ad_map_1760_d90684ce2261b3c9'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/1760?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_1760_d90684ce2261b3c9' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=1760&amp;url= http%3A%2F%2Fwww.netvivs.com%2Fpinterest-slow%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.netvivs.com/pinterest-slow/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to keep alive SSH session in PuttySSH</title>
		<link>http://www.netvivs.com/how-to-keep-alive-ssh-session-in-puttyssh/</link>
		<comments>http://www.netvivs.com/how-to-keep-alive-ssh-session-in-puttyssh/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 10:47:45 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Server Administration]]></category>

		<guid isPermaLink="false">http://www.netvivs.com/?p=1756</guid>
		<description><![CDATA[<a href="http://www.netvivs.com/how-to-keep-alive-ssh-session-in-puttyssh/"><img align="left" hspace="5" width="150" src="http://www.netvivs.com/wp-content/uploads/2012/04/keepalive-ssh-312x300.jpg" class="alignleft wp-post-image tfe" alt="" title="" /></a><p>Sometimes when you use SSH sessions and especially using PuttySSH, you will notice that your session is closed suddenly after a few minutes of inactivity.</p>
<p>In order to <strong>keep your SSH session opened</strong>, you just need to click on &#8230; <a href="http://www.netvivs.com/how-to-keep-alive-ssh-session-in-puttyssh/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>Sometimes when you use SSH sessions and especially using PuttySSH, you will notice that your session is closed suddenly after a few minutes of inactivity.</p>
<p>In order to <strong>keep your SSH session opened</strong>, you just need to click on the Connection -&gt; Keep Alive option that is available in your SSH client. In this case, in the PuttySSH settings window.</p>
<p><img src="http://www.netvivs.com/wp-content/uploads/2012/04/keepalive-ssh-312x300.jpg" alt="" /></p>
<p><map name='google_ad_map_1756_d90684ce2261b3c9'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/1756?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_1756_d90684ce2261b3c9' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=1756&amp;url= http%3A%2F%2Fwww.netvivs.com%2Fhow-to-keep-alive-ssh-session-in-puttyssh%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.netvivs.com/how-to-keep-alive-ssh-session-in-puttyssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use Filezilla to upload files to Amazon EC2</title>
		<link>http://www.netvivs.com/use-filezilla-to-upload-files-to-amazon-ec2/</link>
		<comments>http://www.netvivs.com/use-filezilla-to-upload-files-to-amazon-ec2/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 09:50:16 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Server Administration]]></category>
		<category><![CDATA[amazon ec2]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[sftp]]></category>

		<guid isPermaLink="false">http://www.netvivs.com/?p=1752</guid>
		<description><![CDATA[<a href="http://www.netvivs.com/use-filezilla-to-upload-files-to-amazon-ec2/"><img align="left" hspace="5" width="150" height="150" src="http://www.netvivs.com/wp-content/uploads/2012/04/25_04_12_06_48_05-150x150.png" class="alignleft wp-post-image tfe" alt="" title="" /></a><p>In Amazon Ec2 instance you can Filezilla to transfer files to and from the Amazon EC2 server. This can be used with SFTP protocol and in the same way you did to connect via SSH using your private Key.</p>
<p>In &#8230; <a href="http://www.netvivs.com/use-filezilla-to-upload-files-to-amazon-ec2/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>In Amazon Ec2 instance you can Filezilla to transfer files to and from the Amazon EC2 server. This can be used with SFTP protocol and in the same way you did to connect via SSH using your private Key.</p>
<p>In order to do this, just open Filezilla and go to Settings. Then find the SFTP option and specify the .pem file.</p>
<p><img src="http://www.netvivs.com/wp-content/uploads/2012/04/25_04_12_06_48_05-465x300.png" alt="" /></p>
<p>Then, go to your account list and add a new profile.  Here make sure to enter the host for the instance and specify SFTP as protocolo.</p>
<p>Then make sure to choose Normal as Logon Type and enter ec2-user in the username field.</p>
<p><img src="http://www.netvivs.com/wp-content/uploads/2012/04/25_04_12_06_48_56.png" alt="" /></p>
<p>Now you are ready to connect to your EC2 instance using SFTP.</p>
<p><map name='google_ad_map_1752_d90684ce2261b3c9'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/1752?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_1752_d90684ce2261b3c9' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=1752&amp;url= http%3A%2F%2Fwww.netvivs.com%2Fuse-filezilla-to-upload-files-to-amazon-ec2%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.netvivs.com/use-filezilla-to-upload-files-to-amazon-ec2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Roundabout: jQuery slider alternative with nice animations and effects</title>
		<link>http://www.netvivs.com/roundabout-jquery-slider-alternative-with-nice-animations-and-effects/</link>
		<comments>http://www.netvivs.com/roundabout-jquery-slider-alternative-with-nice-animations-and-effects/#comments</comments>
		<pubDate>Fri, 06 Apr 2012 16:54:14 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.netvivs.com/?p=1744</guid>
		<description><![CDATA[<a href="http://www.netvivs.com/roundabout-jquery-slider-alternative-with-nice-animations-and-effects/"><img align="left" hspace="5" width="150" height="150" src="http://www.netvivs.com/wp-content/uploads/2012/04/roundabout-150x150.jpg" class="alignleft wp-post-image tfe" alt="Roundabout: jQuery slider alternative with nice animations and effects" title="" /></a><p>If you are looking for a nice jQuery slider, then Roundabout is a good alternative. Roundabout is a jQuery slider alternative with nice animations and effects that let you design nice homepages with jQuery sliders for modern web browsers.</p>
<p><img src="http://www.netvivs.com/wp-content/uploads/2012/04/roundabout.jpg" alt="Roundabout: jQuery slider alternative with nice animations and effects" /></p>
<p>The &#8230; <a href="http://www.netvivs.com/roundabout-jquery-slider-alternative-with-nice-animations-and-effects/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>If you are looking for a nice jQuery slider, then Roundabout is a good alternative. Roundabout is a jQuery slider alternative with nice animations and effects that let you design nice homepages with jQuery sliders for modern web browsers.</p>
<p><img src="http://www.netvivs.com/wp-content/uploads/2012/04/roundabout.jpg" alt="Roundabout: jQuery slider alternative with nice animations and effects" /></p>
<p>The slider has many different options including CSS3 animations for images or HTML markup. Roundabout is a jQuery plugin that easily converts unordered lists &amp; other nested HTML structures into entertaining, interactive, turntable-like areas.</p>
<p>Go to <a href="http://fredhq.com/projects/roundabout">http://fredhq.com/projects/roundabout</a></p>
<p>If you are looking for other nice jQuery slider libraries, this article from <a href="http://www.tripwiremagazine.com/2012/03/jquery-slider.html" target="_blank">tripwiremagazine</a> has some other alternatives.</p>
<p><map name='google_ad_map_1744_d90684ce2261b3c9'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/1744?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_1744_d90684ce2261b3c9' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=1744&amp;url= http%3A%2F%2Fwww.netvivs.com%2Froundabout-jquery-slider-alternative-with-nice-animations-and-effects%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.netvivs.com/roundabout-jquery-slider-alternative-with-nice-animations-and-effects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Great libraries for image processing using Java (and Android)</title>
		<link>http://www.netvivs.com/great-libraries-for-image-processing-using-java-and-android/</link>
		<comments>http://www.netvivs.com/great-libraries-for-image-processing-using-java-and-android/#comments</comments>
		<pubDate>Wed, 04 Apr 2012 17:59:52 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[processing]]></category>

		<guid isPermaLink="false">http://www.netvivs.com/?p=1740</guid>
		<description><![CDATA[<a href="http://www.netvivs.com/great-libraries-for-image-processing-using-java-and-android/"><img align="left" hspace="5" width="150" height="150" src="http://www.netvivs.com/wp-content/uploads/2012/04/cvblobandroid-150x150.png" class="alignleft wp-post-image tfe" alt="" title="" /></a><p>Great libraries for image processing using Java (and Android). By using these libraries below you can create nice applications based on image processing and virtual reality. There are many examples available for review.</p>
<p>Computer Vision for Artists</p>
<p><a href="http://webcamxtra.sourceforge.net/">http://webcamxtra.sourceforge.net/</a></p>
<p>BlobDetection</p>
<p><a href="http://www.v3ga.net/processing/BlobDetection/index-page-projects.html">http://www.v3ga.net/processing/BlobDetection/index-page-projects.html</a>&#8230; <a href="http://www.netvivs.com/great-libraries-for-image-processing-using-java-and-android/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>Great libraries for image processing using Java (and Android). By using these libraries below you can create nice applications based on image processing and virtual reality. There are many examples available for review.</p>
<p>Computer Vision for Artists</p>
<p><a href="http://webcamxtra.sourceforge.net/">http://webcamxtra.sourceforge.net/</a></p>
<p>BlobDetection</p>
<p><a href="http://www.v3ga.net/processing/BlobDetection/index-page-projects.html">http://www.v3ga.net/processing/BlobDetection/index-page-projects.html</a></p>
<p>cvBlog for Android</p>
<p><a href="http://code.google.com/p/cvblob-for-android/">http://code.google.com/p/cvblob-for-android/</a></p>
<p><img src="http://www.netvivs.com/wp-content/uploads/2012/04/cvblobandroid-180x300.png" alt="" /></p>
<p>Processing Serial</p>
<p><a href="http://processing.org/reference/libraries/serial/index.html">http://processing.org/reference/libraries/serial/index.html</a></p>
<p>More on Processing for Android API <a href="http://wiki.processing.org/w/Android">http://wiki.processing.org/w/Android</a></p>
<p><map name='google_ad_map_1740_d90684ce2261b3c9'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/1740?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_1740_d90684ce2261b3c9' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=1740&amp;url= http%3A%2F%2Fwww.netvivs.com%2Fgreat-libraries-for-image-processing-using-java-and-android%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.netvivs.com/great-libraries-for-image-processing-using-java-and-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DMCA Template</title>
		<link>http://www.netvivs.com/dmca-template/</link>
		<comments>http://www.netvivs.com/dmca-template/#comments</comments>
		<pubDate>Sun, 25 Mar 2012 23:36:59 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[dmca]]></category>
		<category><![CDATA[intellectual property]]></category>
		<category><![CDATA[legal]]></category>
		<category><![CDATA[rights]]></category>
		<category><![CDATA[templates]]></category>

		<guid isPermaLink="false">http://www.netvivs.com/?p=1736</guid>
		<description><![CDATA[<a href="http://www.netvivs.com/dmca-template/"><img align="left" hspace="5" width="150" height="150" src="http://www.netvivs.com/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a><p>You can embed this DMCA letter in your website to make your users aware that you are committed to respect intellectual property of others.</p>
<pre style="width: 500px;">&#124;YourCompany&#124; respects the intellectual property of others. If you believe that your work has been copied </pre><p>&#8230; <a href="http://www.netvivs.com/dmca-template/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>You can embed this DMCA letter in your website to make your users aware that you are committed to respect intellectual property of others.</p>
<pre style="width: 500px;">|YourCompany| respects the intellectual property of others. If you believe that your work has been copied in a way that constitutes copyright infringement, please follow our Notice and Procedures for Making Claims of Copyright Infringement below.

Notice and Procedure for Making Claims of Copyright Infringement Pursuant to the Digital Millennium Copyright Act.

Service Provider: |YourCompany|

Email Address to Which Notification Should Be Sent: Use the contact form please

To be effective, the notification of your claim of copyright infringement should be written and should include the following:

1. A statement that you are the owner of the exclusive right you claim has been infringed, or a statement that you are authorized to act on behalf of the owner of an exclusive right that has allegedly been infringed.

2. A statement, under penalty of perjury, that the information in the notification is accurate. Your signature. (The signature may be electronic.) The identification of the copyrighted work you claim has been infringed. (If you claim that multiple copyrighted works have been infringed you can submit one notification with a list of the allegedly infringed works.)

3. Identification of the material that you claim to be infringing and information reasonably sufficient to permit |YourCompany| to locate the material. Information reasonably sufficient to permit |YourCompany| to contact you, including your address, telephone number, fax number and, if available, an electronic mail address.

4. You can provide contact information for the owner of the exclusive right that you claim has been infringed if you are not the owner, but rather authorized to act on behalf of the owner.

5. A statement you have a good-faith belief that use of the material in the manner complained of is not authorized by the copyright owner, its agent, or the law.

|YourCompany| will respond to any DMCA complaints in a timely manner. Should you be the copyright holder of a specific piece of content featured on this site without your permission, |YourCompany| will remove it in a timely manner once notified. http://netvivs.com</pre>
<p><map name='google_ad_map_1736_d90684ce2261b3c9'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/1736?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_1736_d90684ce2261b3c9' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=1736&amp;url= http%3A%2F%2Fwww.netvivs.com%2Fdmca-template%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.netvivs.com/dmca-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>isAdmin in Yii</title>
		<link>http://www.netvivs.com/isadmin-in-yii/</link>
		<comments>http://www.netvivs.com/isadmin-in-yii/#comments</comments>
		<pubDate>Tue, 13 Mar 2012 14:07:12 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[access]]></category>
		<category><![CDATA[authorization]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[yii]]></category>

		<guid isPermaLink="false">http://www.netvivs.com/?p=1731</guid>
		<description><![CDATA[<a href="http://www.netvivs.com/isadmin-in-yii/"><img align="left" hspace="5" width="150" height="150" src="http://www.netvivs.com/wp-content/uploads/2012/03/accept-150x150.jpg" class="alignleft wp-post-image tfe" alt="accept" title="Login" /></a><p>isAdmin is one of the most used methods in many frameworks where access and authorization is required. In Yii we can use a similar concept by enabling one of the authentication &#38; authorization extensions.</p>
<p><img title="Login" src="http://www.netvivs.com/wp-content/uploads/2012/03/accept-450x300.jpg" alt="accept" width="270" height="180" /></p>
<p>CWebUser can be decorated with a &#8230; <a href="http://www.netvivs.com/isadmin-in-yii/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>isAdmin is one of the most used methods in many frameworks where access and authorization is required. In Yii we can use a similar concept by enabling one of the authentication &amp; authorization extensions.</p>
<p><img title="Login" src="http://www.netvivs.com/wp-content/uploads/2012/03/accept-450x300.jpg" alt="accept" width="270" height="180" /></p>
<p>CWebUser can be decorated with a checkAccess(&#8216;admin&#8217;) that is inteded to be used in this way. By using checkAccess we can control if the logged user has privileges to access the admin area, which will be similar to execute an isAdmin() function.</p>
<pre>Yii::app()-&gt;user-&gt;checkAccess('admin');</pre>
<p><map name='google_ad_map_1731_d90684ce2261b3c9'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/1731?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_1731_d90684ce2261b3c9' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=1731&amp;url= http%3A%2F%2Fwww.netvivs.com%2Fisadmin-in-yii%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.netvivs.com/isadmin-in-yii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to implement OpenID in Yii to sign in with Google Account</title>
		<link>http://www.netvivs.com/how-to-implement-openid-in-yii-to-sign-in-with-google-account/</link>
		<comments>http://www.netvivs.com/how-to-implement-openid-in-yii-to-sign-in-with-google-account/#comments</comments>
		<pubDate>Sat, 10 Mar 2012 03:33:30 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[oauth]]></category>
		<category><![CDATA[openid]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[yii]]></category>

		<guid isPermaLink="false">http://www.netvivs.com/?p=1722</guid>
		<description><![CDATA[<a href="http://www.netvivs.com/how-to-implement-openid-in-yii-to-sign-in-with-google-account/"><img align="left" hspace="5" width="150" src="http://www.netvivs.com/wp-content/uploads/2012/03/eauth-yii-openid-431x300.jpg" class="alignleft wp-post-image tfe" alt="" title="" /></a><p>After digging and digging around I came to a good article explaining how to integrate OpenID in Yii application to sign in using OpenID account like Google Account, Facebook or Yahoo.</p>
<p><img src="http://www.netvivs.com/wp-content/uploads/2012/03/eauth-yii-openid-431x300.jpg" alt="" /></p>
<p>The OpenID example uses EAuth as a Yii extension &#8230; <a href="http://www.netvivs.com/how-to-implement-openid-in-yii-to-sign-in-with-google-account/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>After digging and digging around I came to a good article explaining how to integrate OpenID in Yii application to sign in using OpenID account like Google Account, Facebook or Yahoo.</p>
<p><img src="http://www.netvivs.com/wp-content/uploads/2012/03/eauth-yii-openid-431x300.jpg" alt="" /></p>
<p>The OpenID example uses EAuth as a Yii extension and creates a sub class of UserIdentity.</p>
<p>The article is by far one of the best resources I found on this topic and I can&#8217;t understand why this post didn&#8217;t come up on the first Google result pages.</p>
<p><a href="http://umumble.com/blogs/yii/292/">http://umumble.com/blogs/yii/292/</a></p>
<p>&nbsp;</p>
<p><map name='google_ad_map_1722_d90684ce2261b3c9'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/1722?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_1722_d90684ce2261b3c9' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=1722&amp;url= http%3A%2F%2Fwww.netvivs.com%2Fhow-to-implement-openid-in-yii-to-sign-in-with-google-account%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.netvivs.com/how-to-implement-openid-in-yii-to-sign-in-with-google-account/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenID Recipe</title>
		<link>http://www.netvivs.com/openid-recipe/</link>
		<comments>http://www.netvivs.com/openid-recipe/#comments</comments>
		<pubDate>Sat, 10 Mar 2012 02:35:40 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Articles]]></category>

		<guid isPermaLink="false">http://www.netvivs.com/?p=1723</guid>
		<description><![CDATA[<a href="http://www.netvivs.com/openid-recipe/"><img align="left" hspace="5" width="150" src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1016/839038415_f89f2e8f0b_s.jpg" class="alignleft wp-post-image tfe" alt="Plaxo registration page with OpenID link" title="" /></a><p>I am sorry to the real author of this post but I came to the need to integrate OpenID into a Yii application. After digging around I found that some links pointed to a page explaining the OpenID recipe that &#8230; <a href="http://www.netvivs.com/openid-recipe/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>I am sorry to the real author of this post but I came to the need to integrate OpenID into a Yii application. After digging around I found that some links pointed to a page explaining the OpenID recipe that was not longer available in the site. After researching on Archive.org for a copy, I finally ended with the original article, so in order to help the community I brought it here.</p>
<p>The article was prepared by  <a href="http://web.archive.org/web/20100105045506/http://josephsmarr.com/">Joseph Smarr</a> at <a href="http://web.archive.org/web/20100105045506/http://www.plaxo.com/">Plaxo</a> on July 18, 2007</p>
<h3>A Recipe for OpenID-Enabling Your Site</h3>
<p><em>Prepared by <a href="http://web.archive.org/web/20100105045506/http://josephsmarr.com/">Joseph Smarr</a> at <a href="http://web.archive.org/web/20100105045506/http://www.plaxo.com/">Plaxo</a> on July 18, 2007.</em></p>
<p>This is a step-by-step tutorial guide for implementing <a href="http://web.archive.org/web/20100105045506/http://openid.net/">OpenID</a> consumer-side support with a web site that already has users with accounts. It will explain how to easily let new users sign up for an account on your site using their OpenID URL and how to let existing users attach their OpenID(s) so they can sign in using them.</p>
<p>I developed this guide by talking to fellow OpenID developers at the <a href="http://web.archive.org/web/20100105045506/http://iiw.windley.com/wiki/Workshop_2007">Internet Identity Workshop</a> and elsewhere, and by <a href="http://web.archive.org/web/20100105045506/http://www.plaxo.com/api/openid">implementing OpenID support for Plaxo</a> using these instructions. I&#8217;ve also posted <a href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/sets/72157600872488686/detail/">detailed screenshots</a> of Plaxo&#8217;s implementation for reference. I&#8217;ve intended for this guide to be clear and complete and to follow best-practices, but if you have any questions or feedback, please let me know at or by posting a comment on <a href="http://web.archive.org/web/20100105045506/http://blog.plaxo.com/">Plaxo&#8217;s blog</a>.</p>
<p>This guide may look a bit long, but my hope is you can just follow it straight through without thinking much, and you&#8217;ll be completely done by the time you reach the end! <img src='http://www.netvivs.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>Overview</h3>
<p><strong>I&#8217;m assuming your web site currently has:</strong></p>
<ul>
<li>A user database with rows for each user
<ul>
<li>Each user has a unique internal user ID</li>
<li>Users currently sign in using a username/e-mail and password</li>
</ul>
</li>
<li>A registration flow for signing up new users and getting collecting basic profile info</li>
<li>A signin page for authenticating users
<ul>
<li>Internally you authenticate users based on username/e-mail and password, look up their unique user ID, and use it in the rest of your site</li>
</ul>
</li>
<li>A settings page for users to manage their account info.</li>
</ul>
<p>If your site doesn&#8217;t look like this, you should still be able to follow along, but some of the sections may not be relevant to you.</p>
<p><strong>Here&#8217;s an overview of what you&#8217;re going to add to your site:</strong></p>
<ol>
<li>A <strong>new database table</strong> to map OpenIDs to your internal user IDs
<ul>
<li>It&#8217;s a many-to-one relationship (each user can have multiple OpenIDs attached to their account, but a given OpenID can only be claimed by a single user)</li>
<li>This table will be a global registry to look up users by OpenID, so in general you&#8217;ll need to make it a single shared table for all your users</li>
</ul>
</li>
<li>A small bit of OpenID UI on your <strong>registration page</strong> for new users
<ul>
<li>New users will enter their OpenID, authenticate with their OpenID provider, and return to your registration flow authenticated with any profile info they&#8217;ve chosen to share with your site</li>
</ul>
</li>
<li>A small bit of OpenID UI on your <strong>signin page</strong> for existing users
<ul>
<li>Users that have attached an OpenID to their account will enter their OpenID, authenticate with their OpenID provider, and return to your signin page authenticated. You can then map their OpenID to their user ID and sign them in like you would if they&#8217;d entered their username/e-mail and password.</li>
</ul>
</li>
<li>An OpenID <strong>settings page</strong> where users can list, add, and remove the OpenIDs attached to their account</li>
</ol>
<p><strong>Here&#8217;s a summary of what you&#8217;re going to build:</strong></p>
<ol>
<li>An <strong>OpenID database table</strong>
<ul>
<li>Columns: (openid_url, user_id). openid_url is a text string, user_id is whatever you currently use internally to represent users.</li>
<li>primary key on openid_url (unique, for looking up users by OpenID)</li>
<li>index on user_id (for listing all OpenIDs attached to a given user&#8217;s account)</li>
</ul>
</li>
<li>A new web page / CGI to <strong>look up the OpenID</strong> entered by a user and <strong>redirect to their OpenID provider</strong>
<ul>
<li>Need to look up whether the OpenID entered already belongs to an existing user on your site</li>
<li>Need to redirect to the OpenID provider (using an OpenID library) so the user can authenticate (details below)</li>
</ul>
</li>
<li>A new web page / CGI to <strong>handle the response</strong> from the user&#8217;s OpenID provider
<ul>
<li>Need to verify the response (using an OpenID library)</li>
<li>For new users, you&#8217;ll need to send them to your registration flow and pre-fill any registration info they sent you from their OpenID provider. You&#8217;ll also need to modify your registration flow slightly to not ask these users for a password (since they&#8217;ll be signing in with their OpenID).</li>
<li>For existing users, you&#8217;ll need to attach the verified OpenID to their account (if this is the first time they&#8217;ve used it) and sign them in to their account by looking up the corresponding user id.</li>
</ul>
</li>
<li>A new web page / CGI to <strong>manage a user&#8217;s attached OpenIDs</strong>
<ul>
<li>Need to be able to fetch and list all OpenIDs attached to the currently signed-in user</li>
<li>Need to let users attach an additional OpenID (using the flow mentioned above)</li>
<li>Need to let users remove (i.e. detach) an existing OpenID</li>
</ul>
</li>
<li>A hook in your delete-user code to <strong>remove any attached OpenIDs upon deletion</strong></li>
</ol>
<p><strong>You&#8217;ll need the following resources to get started:</strong></p>
<ul>
<li>An OpenID consumer library in your programming language of choice. Plaxo&#8217;s backend is in C++, so we used <a href="http://web.archive.org/web/20100105045506/http://kin.klever.net/libopkele/">libopkele</a> (thanks to Michael and the rest of the <a href="http://web.archive.org/web/20100105045506/http://kin.klever.net/">Klever</a> team for providing this great open-source library!), but there are <a href="http://web.archive.org/web/20100105045506/http://openid.net/wiki/index.php/Libraries">libraries available</a> in lots of languages.</li>
<li>Some standard OpenID graphics for use in your UI, e.g. the <a href="http://web.archive.org/web/20100105045506/http://www.plaxo.com/images/openid/login-bg.gif">small icon</a> and logo (<a href="http://web.archive.org/web/20100105045506/http://www.plaxo.com/images/openid/openid-logo-small.png">small</a>, <a href="http://web.archive.org/web/20100105045506/http://www.plaxo.com/images/openid/openid-logo.png">normal</a>, <a href="http://web.archive.org/web/20100105045506/http://www.plaxo.com/images/openid/openid-logo.pdf">PDF</a>)</li>
<li>An OpenID provider site to test with. Some examples are <a href="http://web.archive.org/web/20100105045506/http://www.myopenid.com/">MyOpenID.com</a>, <a href="http://web.archive.org/web/20100105045506/http://www.livejournal.com/">LiveJournal</a>, and <a href="http://web.archive.org/web/20100105045506/http://www.claimid.com/">ClaimID</a>. Also, if you have an AOL/AIM screen name, you can use  http://openid.aol.com/SCREENAME as an OpenID.</li>
</ul>
<p><strong>Implementing OpenID consumer support will have the following immediate benefits:</strong></p>
<ul>
<li>Any of the over 120 million users with OpenIDs will be able to sign up for your site more easily and quickly than before, since they won&#8217;t need to create and remember yet another login and password and since they can provide pre-filled registration info.</li>
<li>You will be able to start collecting OpenIDs for your users, so as more OpenID-enabled services become available, your users will be able to easily take advantage of them in conjunction with your site.</li>
<li>You will demonstrate your thought leadership and commitment to your users by supporting this key emerging open standard for online identity.</li>
</ul>
<p><strong>In addition, as OpenID support continues to spread, you can expect the following additional benefits in the future:</strong></p>
<ul>
<li>The ability to automatically link your users&#8217; accounts on other web sites so you can share information for mashups and remove the friction of making your users enter the same information in multiple places.</li>
<li>The ability to be notified when users change their info on other sites, so you can always have their latest info on your site.</li>
<li>The ability to accept signed, trusted claims from other sites and services, such as age verification, validated e-mail addresses, confirmed group memberships, and more.</li>
</ul>
<h2>Implementation details</h2>
<ol start="0">
<li>Install an <strong>OpenID consumer library</strong>
<ul>
<li>There are <a href="http://web.archive.org/web/20100105045506/http://openid.net/wiki/index.php/Libraries">OpenID libraries</a> already available in many popular programming languages that will do almost all of the heavy lifting for you. The team at <a href="http://web.archive.org/web/20100105045506/http://www.janrain.com/">JanRain</a> wrote a bunch of them and are generally super-smart and knowledgeable when it comes to OpenID, so they&#8217;d probably make a good resource if you need help here.</li>
<li>Depending on the library, you may need to provide a persistent store for associations with OpenID provider sites. Essentially this is just storing a mapping from a server/handle string to an association string. You&#8217;ll need to store the association at least for the session (to verify an OpenID authentication) but ideally you should store them longer so you won&#8217;t have to re-associate every time you redirect to the OpenID provider (doing so will result in a faster redirect). You can use memcached, a database, or any other persistent storage medium you have access to.</li>
</ul>
</li>
<li>Create a new<strong> OpenID database table</strong>
<ul>
<li>Use a schema like this (this will work with MySQL, but you may have to tweak it slightly if you use a different database or if you represent your internal user IDs differently):
<pre>create table user_openids (
  openid_url varchar(255) not null,
  primary key (openid_url),

  user_id int not null,
  index (user_id)
);</pre>
</li>
<li>Keep a single global table so you can use it to look up OpenIDs for all your users (even if you have your users partitioned into multiple databases).</li>
<li>Store OpenID URLs in <em>canonicalized</em> form for robust lookup (i.e. so if users enter their OpenID slightly differently next time, you can still map it to their account). Most OpenID libraries will provide a canonicaliztion function, but briefly you should add http:// if it&#8217;s missing and you should convert the protocol and domain to lowercase (but NOT the rest of the URL), so e.g. &#8220;WWW.AOL.COM/myOpenID&#8221; should be stored as &#8220;http://www.aol.com/myOpenID&#8221;. You should also probably remove any trailing slashes from the URL.</li>
<li>If you usually have a layer of database-access code, you should expose the following functions to your application (in each case I&#8217;ve sketched the SQL to implement the function). As a reminder, all functions that take an OpenID as input should canonicalize it prior to looking it up in the database.
<ul>
<li><strong>GetUserId</strong>(<em>openid_url</em>)<br />
<code>select user_id from user_openids where openid_url = <em>openid_url</em></code></li>
<li><strong>GetOpenIDsByUser</strong>(<em>user_id</em>)<br />
<code>select openid_url from user_openids where user_id = <em>user_id</em></code></li>
<li><strong>AttachOpenID</strong>(<em>openid_url</em>, <em>user_id</em>)<br />
<code>insert into user_openids values (<em>openid_url</em>, <em>user_id</em>)</code></li>
<li><strong>DetachOpenID</strong>(<em>openid_url</em>, <em>user_id</em>)<br />
<code>delete from user_openids where openid_url = <em>openid_url</em> and user_id = <em>user_id</em></code></li>
<li><strong>DetachOpenIDsByUser</strong>(<em>user_id</em>)<br />
<code>delete from user_openids where user_id = user_id<br />
</code></li>
</ul>
</li>
</ul>
</li>
<li>Add OpenID UI to your <strong>registration page</strong>
<ul>
<li>Add a section to your registration page where OpenID users can sign up using their OpenID. The UI goal should be that OpenID users can easily identify that your site supports OpenID, but that users without OpenID can continue to register normally without being confused. You can either put an OpenID input box directly on the page or link to an OpenID page where users can enter their OpenID.</li>
<li>Wherever you put it, you should follow the community standards for naming and styling the text field where users enter their OpenID:
<ul>
<li>Use &#8220;openid_url&#8221; as the ID and name attributes of the text field (this will allow plug-ins to easily identify and handle OpenID input boxes across different web sites)</li>
<li>Add the <a href="http://web.archive.org/web/20100105045506/http://www.myopenid.com/static/openid-icon-small.gif">small OpenID logo</a> as a background image to the text box, using CSS like this:
<pre>background: #FFFFFF url('/images/openid-icon-small.gif') no-repeat scroll 0pt 50%;
padding-left: 18px;</pre>
</li>
</ul>
</li>
<li>It&#8217;s also a good idea to provide a brief explanation of what OpenID is and how your users can use it on your site (since you&#8217;ll probably get curious people clicking through to take a look).</li>
<li>Wrap the OpenID text box in a form that will submit to your OpenID login CGI, which we&#8217;ll build below.</li>
<li>Upon providing an OpenID and signing in to the OpenID provider, you&#8217;ll need to redirect your user back to your registration page with a couple of small tweaks. First, you should show the OpenID that the user is registering with, preferably with the small OpenID logo next to it to consistently identify it as an OpenID (see the screenshots below for an example). Second, you should NOT ask the user for a site-specific password, since they&#8217;ll be signing in with their OpenID. So hide the password fields and make sure your registration code will allow this (you may need to stick in a random password behind the scenes if your code requires some password text, just don&#8217;t show it to the user). [Note: it's fine to let users enter a site-specific password later by using your account settings page, but the point here is that one of the major benefits you're providing OpenID users is that they no longer<em> need </em>to maintain separate credentials for each site they use.]</li>
<li>Here are some screenshots of how we added OpenID to Plaxo&#8217;s registration flow:<br />
<a title="Plaxo registration page with OpenID link" href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/839038415/"><img src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1016/839038415_f89f2e8f0b_s.jpg" alt="Plaxo registration page with OpenID link" width="75" height="75" border="2" /></a> <a title="Plaxo OpenID page" href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/839038427/"><img src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1206/839038427_219fbfc132_s.jpg" alt="Plaxo OpenID page" width="75" height="75" border="2" /></a> <a title="Returning to Plaxo registration with a verified OpenID" href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/839038449/"><img src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1248/839038449_71058ada30_s.jpg" alt="Returning to Plaxo registration with a verified OpenID" width="75" height="75" border="2" /></a> <a title="Plaxo registration is pre-filled with simple-registration data from the OpenID provider" href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/839074877/"><img src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1355/839074877_78f39bf5c6_s.jpg" alt="Plaxo registration is pre-filled with simple-registration data from the OpenID provider" width="75" height="75" border="2" /></a></li>
</ul>
</li>
<li>Add OpenID UI to your <strong>signin page</strong>
<ul>
<li>Add a section to your signin page where OpenID users can sign in using their OpenID. This will work both for existing users of your site that have attached an OpenID to their account and new users, who will be able to sign up using their OpenID (using the same flow as above). Like with the registration page, the UI goal should be a balance between being obvious to OpenID users without overly distracting or confusing the rest of your users. You should name and style your OpenID box as specified above in the registration page. And like above, the form surrounding the OpenID input box should go to the OpenID login CGI you&#8217;re about to build.</li>
<li>In addition to your main signin page, you may also have signin UI in your home page or elsewhere. You should ideally provide an option to sign in using OpenID in every place you provide a traditional signin option.</li>
<li>Here are some screenshots of how we added OpenID to Plaxo&#8217;s signin pages:<br />
<a title="Plaxo signin page with OpenID option" href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/839038439/"><img src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1075/839038439_a8bf14a918_s.jpg" alt="Plaxo signin page with OpenID option" width="75" height="75" /></a> <a title="Plaxo homepage signin UI with OpenID option" href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/839038393/"><img src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1404/839038393_6229c75d66_s.jpg" alt="Plaxo homepage signin UI with OpenID option" width="75" height="75" /></a> <a title="Plaxo homepage signin UI with OpenID option selected" href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/839038403/"><img src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1403/839038403_921ccb13aa_s.jpg" alt="Plaxo homepage signin UI with OpenID option selected" width="75" height="75" /></a></li>
</ul>
</li>
<li>Create a new <strong>OpenID login</strong> web page / CGI</li>
<ul>
<li>Your CGI should take two basic input (query) parameters:
<ul>
<li><strong>openid_url</strong>: the OpenID entered by the user (for registration, signin, attaching, etc.)</li>
<li><strong>action_type</strong>: the operation the user wants to perform. Possible values will be <em>login</em>, <em>complete</em>, <em>attach</em>, <em>list</em>, and <em>delete</em>. (If you&#8217;re using Rails or a similar system, these could also be controller methods and thus part of the URL itself.)</li>
</ul>
</li>
<li>Implement the <strong>login</strong> action (this is where the UI you added to the registration and signin flows will both submit to)</li>
<ol>
<li>Look up the provided openid_url using the <strong>GetUserId</strong> function described above.</li>
<li>If the OpenID is already attached to a user in your system, check to see if the user is currently signed in to your site.</li>
<ol>
<li>If the user is not signed in, they are attempting to sign in as an existing user, so prepare to redirect to their OpenID provider, but set a flag to NOT ask the provider for registration info (since the user is not signing up for a new account).</li>
<li>If the user is already signed in, and this OpenID already belongs to them (i.e. the OpenID URL is mapped to the same user_id as the currently signed-in user), then you don&#8217;t have to do anything (this user is already signed in and already attached that OpenID, so this is a no-op). This is an edge case.</li>
<li>If the user is already signed in but the OpenID belongs to a <em>different</em> user, show an error message saying that this OpenID has already been claimed by another user. You can also provide the user the option to sign out and try again. This is an edge case.</li>
</ol>
<li>If the OpenID is NOT currently in your database, the user is trying to sign up for a new account, so prepare to redirect to their OpenID provider and ask for registration info.</li>
<li>Save the provided openid_url in your session, since you&#8217;ll need it to remember it when the OpenID provider redirects back to you, and the provider may not return it to you. If you don&#8217;t have a session, you can use your database, but it has to be somewhere persistent and protected from user-tampering (i.e. not in a cookie or something that could be changed or forged by the user).<br />
(The reason you need to store the requested OpenID is that OpenID lets users <em>delegate</em> their OpenID to another provider behind-the-scenes. For instance, if I try to sign up with the OpenID josephsmarr.com, I may have actually<a href="http://web.archive.org/web/20100105045506/http://simonwillison.net/2006/Dec/19/openid/">delegated</a> that URL to a different OpenID like jsmarr.myopenid.com, and when the provider returns to you to complete authentication, you need to remember that I wanted to sign up as josephsmarr.com and not jsmarr.myopenid.com. Luckily your OpenID library will most likely handle this for you, but you still have to keep the originally requested OpenID in your session for now. This may be solved in the upcoming OpenID 2.0 spec.)</li>
<li>Construct your return_to URL for the OpenID provider to return to after the user has authenticated. This will be your OpenID login CGI with the <em>complete </em>action specified.</li>
<li>If you&#8217;ve determined above that the user is registering for a new account, decide what registration info to ask for. Most OpenID providers support the <a href="http://web.archive.org/web/20100105045506/http://www.openidenabled.com/openid/simple-registration-extension">simple-registration extension</a>, which is a list of common registration fields that you can request as required or optional for your site, including full name, e-mail, nickname, gender, date of birth, gender, postal code, country, language, and time zone. If you ask for these fields and the user consents to provide them, you can pre-fill them into your registration flow, thus removing time and friction from your registration process. If your OpenID consumer library doesn&#8217;t natively support requesting simple-registration parameters, see if they have a general facility for supporting extensions, or worst-case you can manually add it to the generated redirect URL before redirecting.</li>
<li>Call <strong>checkid_setup</strong> in your OpenID library to generate the URL to redirect to the user&#8217;s OpenID provider. Pass in the (canonicalized) OpenID provided by the user and the return_to URL you constructed above. Also pass in the simple registration info you want if appropriate. Depending on your library, you may need to trap and handle some errors from this function. But assuming everything goes well, it will give you back a URL to redirect to.</li>
<li>Have your CGI redirect to the provided URL, ideally by issuing a server-side redirect response.</li>
<li>The user will be redirected to their OpenID provider&#8217;s web site. They will be asked to sign in (unless they&#8217;ve recently signed in there), they will be asked whether they trust your web site, and if you&#8217;ve asked for simple registration info, they&#8217;ll be asked what info they want to share with you. Once they complete this process, the OpenID provider will redirect the user back to the return_to URL you supplied, which will then let you initiate your <em>complete</em> action to finish the job.Here are some screenshots of signing into an OpenID provider (myopenid.com in this case) and being prompted to share some registration info with Plaxo:<br />
<a title="OpenID provider signin page" href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/839964012/"><img src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1398/839964012_e464d87ebb_s.jpg" alt="OpenID provider signin page" width="75" height="75" /></a> <a title="OpenID provider registration info page" href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/839964326/"><img src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1328/839964326_bbcebbdfcc_s.jpg" alt="OpenID provider registration info page" width="75" height="75" /></a></li>
</ol>
<li>Implement the <strong>complete</strong> action (this is where the user gets redirected after signing in to their OpenID provider):
<ol>
<li>When the OpenID provider redirects to your return_to URL, they will add a bunch of additional query string parameters that contain the information needed to verify the user&#8217;s authentication with this OpenID. Depending on the OpenID library you&#8217;re using, you may need to gather these up into a data structure to pass in to the verification function, or it may do it for you.</li>
<li>Get the OpenID the user initially requested from your session (you stored it before redirecting to the OpenID provider above).</li>
<li>Call <strong>id_res</strong> in your OpenID library to verify the authentication data you&#8217;ve been sent by the OpenID provider. Pass in the OpenID that the user initially requested, along with the query parameters as needed. This function will check to see if everything looks valid. If you get an error back, display an appropriate error message to your user. Otherwise you&#8217;ve now confirmed that the user has authenticated the OpenID they provided to you.</li>
<li>Optional: after successfully verifying the OpenID, you may wish to set a persistent cookie for your site with the OpenID used so that you can recognize that the user has an OpenID next time they come to your site and pre-fill the OpenID box on the signin page. If you do this, make sure to also clear the cookie when the user explicitly signs out.</li>
<li>Look up the verified OpenID again using the <strong>GetUserId</strong> function. If you don&#8217;t find it in your database, check to see if the user is currently signed in on your site. If they are, perform the <em>attach</em> action below to attach this OpenID to their existing account. Otherwise, it&#8217;s time to start the registration process for a new account using this OpenID. Start by storing the verified OpenID in your session so your account creation code will remember the user has already verified this OpenID. (Do NOT use the same session variable you used to store the <em>requested</em> OpenID, since the user can type in anything there.)<br />
Then redirect your user to your registration flow and pass along the simple registration data you got back (if any). You will probably have to map the fields returned by simple-registration to the registration parameters that your site normally takes.</p>
<ul>
<li>As described above, the registration page should show the OpenID prominently in the account information, and you should NOT ask the user to enter a password for your site, since they&#8217;ll be using their OpenID to sign in. In addition, you should pre-fill any registration info provided from their OpenID provider. It is fine to ask for additional registration info and maintain your current policies about which fields are required and optional. (Using OpenID should be an <em>acceleration</em> for registering on your site, but should not require you to change what information you require or otherwise change your site&#8217;s normal behavior). Finally, you should provide a link for existing users of your service to attach this OpenID to their existing account, if they have one. This will handle the case of existing users that weren&#8217;t signed in and entered their OpenID and have no found themselves in the new-user registration flow. [Since this isn't common, it's better to just have a small link at the beginning of the registration flow rather than asking every user "do you want to register a new account or sign in to an existing account" when they first verify their OpenID.]</li>
<li>When the user completes your site&#8217;s registration flow and you create a user account, attach the verified OpenID to the newly created account using your <strong>AttachOpenID</strong> function. [If your user table and OpenID table are in separate databases and cannot be part of the same transaction, there is a small chance that the attach command could fail and leave you with an orphaned user account. There&#8217;s no easy way to prevent this in 100% of cases, but since it&#8217;s rare and the user can always sign up again, in most cases you can ignore this race condition and just hope for the best.</li>
</ul>
</li>
<li>If you found that the verified OpenID was attached to an existing account, you can now sign the user in as you normally would if they&#8217;d signed in through your traditional method. (If the user happens to be signed in to a different account, sign them out and then sign them in as the user the OpenID is attached to, since they just proved they own it).</li>
</ol>
</li>
<li>Implement the <strong>attach</strong> action (for existing users to attach additional OpenIDs to their account):
<ol start="0">
<li>(This action will be called as part of the <em>complete</em> action when the user is already signed in and has just verified a new OpenID. So make sure the user is signed in before calling this action.)</li>
<li>Attach the verified OpenID to the signed-in user&#8217;s account using your <strong>AttachOpenID</strong> function.</li>
<li>Show a confirmation message that this OpenID has now been attached and can be used to sign in from now on. Consider redirecting to the <em>list</em> action so the user can now see this OpenID among the list of attached OpenIDs for their account.Here&#8217;s a screenshot of Plaxo&#8217;s attach confirmation page:<br />
<a title="Attaching an OpenID to an existing Plaxo account" href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/839991898/"><img src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1203/839991898_d6828ba472_s.jpg" alt="Attaching an OpenID to an existing Plaxo account" width="75" height="75" /></a></li>
</ol>
</li>
<li>Implement the <strong>list</strong> action (for showing a signed-in user the OpenIDs attached to their account):
<ol>
<li>Require the user to be signed in (redirect through your signin page first if needed).</li>
<li>Fetch the list of attached OpenIDs for the signed-in user by calling your <strong>GetOpenIDsByUser</strong> function.</li>
<li>Show the list of OpenIDs in a web page with a link by each one to detach it if the user wants. The links will call the<em>delete</em> action below and pass in the OpenID to delete as the <em>openid_url</em> parameter.</li>
<li>Provide a link or input box to attach an additional OpenID. This will take the user through the <em>login</em> and <em>attach</em> flows (since the user is already signed in) and end up back on the <em>list</em> page.</li>
<li>If your site already has a general settings page, you should provide a link to &#8220;Manage your OpenIDs&#8221; that links to this<em>list</em> page. You may also decide to build this functionality directly into your current settings page.Here&#8217;s a screenshot of Plaxo&#8217;s list page, as well as links to it from our current settings pages:<br />
<a title="Listing your attached OpenIDs on Plaxo" href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/839074973/"><img src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1394/839074973_e5f1227e5b_s.jpg" alt="Listing your attached OpenIDs on Plaxo" width="75" height="75" /></a> <a title="Link to manage OpenIDs in Plaxo 3.0 settings" href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/839074949/"><img src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1335/839074949_022fca33fe_s.jpg" alt="Link to manage OpenIDs in Plaxo 3.0 settings" width="75" height="75" /></a> <a title="PLink to manage OpenIDs in Plaxo 2.0 settings" href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/839074963/"><img src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1237/839074963_90745b3050_s.jpg" alt="Link to manage OpenIDs in Plaxo 2.0 settings" width="75" height="75" /></a></li>
</ol>
</li>
<li>Implement the <strong>delete</strong> action (for detaching an OpenID from a user&#8217;s account):
<ol>
<li>Require the user to be signed in (redirect through your signin page first if needed).</li>
<li>Optional: Check whether the user is trying to delete the last credential they could use to sign in to your site. If the user has not set up a normal password on your site and this is the only OpenID attached to their account, deleting their last OpenID would essentially lock them out of their account forever. If you don&#8217;t have a good way to recover users in this situation, show an error message if the user tries to delete their last attached credential, saying essentially &#8220;You can&#8217;t delete the last OpenID attached to your account because you&#8217;d have no way to sign in. First attach another OpenID or create a password for this site.&#8221;</li>
<li>Assuming it&#8217;s ok to proceed, detach the OpenID provided by the openid_url parameter from the signed-in user&#8217;s account by calling your <strong>DetachOpenID</strong> function. If the OpenID provided is not currently attached to the user&#8217;s account, you can choose to show an error or just treat it as a no-op success.</li>
<li>Show a confirmation message that this OpenID has now been detached and can no longer be used to sign in to your site. Tell the user that if they want to re-attach this OpenID, they will have to go through the normal verification process to re-attach it. Consider redirecting to the <em>list</em> action so the user can see the updated list of OpenIDs attached to their account.Here are some screenshots of detaching an OpenID from a Plaxo account:<br />
<a title="Confirming that a user wants to detach an OpenID from their Plaxo account" href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/839075059/"><img src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1421/839075059_c0444091f5_s.jpg" alt="Confirming that a user wants to detach an OpenID from their Plaxo account" width="75" height="75" /></a> <a title="Confirmation of a detached OpenID" href="http://web.archive.org/web/20100105045506/http://www.flickr.com/photos/plaxo/839964000/"><img src="http://web.archive.org/web/20100105045506im_/http://farm2.static.flickr.com/1068/839964000_079d70211a_s.jpg" alt="Confirmation of a detached OpenID" width="75" height="75" /></a></li>
</ol>
</li>
<li>Add a hook to your delete-user routine to <strong>detach all OpenIDs </strong>from that user.
<ol>
<li>If your site currently lets users delete their accounts, it&#8217;s important that you also detach any OpenIDs that were attached so they can be re-attached to another account later. You can do this by calling your <strong>DetachOpenIDsByUser</strong>function inside your delete-user routine, or by otherwise triggering this function when deleting a user.</li>
</ol>
</li>
</ul>
</ol>
<h3>&#8230;and you&#8217;re done!</h3>
<p>If you&#8217;ve made it this far, congratulations! You&#8217;ve now got all the tools you need to OpenID-enable your web site. The steps above should be thorough and complete, but it helps to bear in mind the following best-practices throughout your implementation:</p>
<ul>
<li>Whenever you&#8217;re displaying a user&#8217;s OpenID on a page, precede it with the small OpenID icon to clearly identify it. See the registration screenshots above as an example. (A possible exception is on the list page if your UI makes it clear that you&#8217;re presenting a list of OpenIDs, but it wouldn&#8217;t hurt!)</li>
<li>In general, you should require opt-in consent from your users before you display their OpenIDs in public or to other users of your site. A user may want to share their OpenID as a public identifier, but you should assume by default that they want to use it as a private means of signing in and not an attribute on their public profile.</li>
<li>Starting with the OpenID 2.0 spec (to be completed very soon; most sites currently use v1.1, but don&#8217;t worry, you don&#8217;t have to change anything above to comply with OpenID 2.0 servers), users will also be able to sign in using <a href="http://web.archive.org/web/20100105045506/http://www.xdi.org/i-names-explained.html">i-names</a> like <tt>=joseph.smarr</tt> as OpenIDs. This should hopefully be transparent to your implementation, but if you plan to publicly display users&#8217; i-names in the future, now would be a good time to start restricting your users from registering normal nicknames that start with an = or @ sign, since they could be confused with authenticated i-names. Many sites already disallow nicknames that start with characters like this, but it&#8217;s worth a look.</li>
<li>OpenID is already being widely adopted, but remember that the problem of providing web-scale user-centric identity is still a work in progress, so speak up if you have questions or feedback on how things work! Contribute to sites like openid.net and OpenIDEnabled.com, post comments and blog entries, or whatever else you can do join the conversation. If you&#8217;re passionate about identity on the web, providing OpenID support on your site is a great start. Becoming an ongoing contributor in the community will continue the investment and help ensure we all get the web we want as users!</li>
</ul>
<p><map name='google_ad_map_1723_d90684ce2261b3c9'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/1723?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_1723_d90684ce2261b3c9' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=1723&amp;url= http%3A%2F%2Fwww.netvivs.com%2Fopenid-recipe%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.netvivs.com/openid-recipe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a URL in Yii without a link</title>
		<link>http://www.netvivs.com/create-a-url-in-yii-without-a-link/</link>
		<comments>http://www.netvivs.com/create-a-url-in-yii-without-a-link/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 18:09:12 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[yii]]></category>

		<guid isPermaLink="false">http://www.netvivs.com/?p=1715</guid>
		<description><![CDATA[<a href="http://www.netvivs.com/create-a-url-in-yii-without-a-link/"><img align="left" hspace="5" width="150" height="150" src="http://www.netvivs.com/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a><p>This snippet will let you create a URL in Yii without using the CHtml link.</p>
<p>&#60;?php echo Yii::app()-&#62;createUrl(&#8216;presentation/view&#8217;, array(&#8216;id&#8217;=&#62;$data-&#62;id)); ?&#62;</p>
<p>This can be helpful if you want to create the link manually.</p>
<p>&#160;</p>
<p>&#160;</p>
<p>


<img usemap='#google_ad_map_1715_d90684ce2261b3c9' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&#38;client=&#38;channel=&#38;output=png&#38;cuid=1715&#38;url= http%3A%2F%2Fwww.netvivs.com%2Fcreate-a-url-in-yii-without-a-link%2F' />&#8230; <a href="http://www.netvivs.com/create-a-url-in-yii-without-a-link/" class="read_more">Read the rest</a></p>]]></description>
			<content:encoded><![CDATA[<p>This snippet will let you create a URL in Yii without using the CHtml link.</p>
<p>&lt;?php echo Yii::app()-&gt;createUrl(&#8216;presentation/view&#8217;, array(&#8216;id&#8217;=&gt;$data-&gt;id)); ?&gt;</p>
<p>This can be helpful if you want to create the link manually.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><map name='google_ad_map_1715_d90684ce2261b3c9'>
<area shape='rect' href='http://imageads.googleadservices.com/pagead/imgclick/1715?pos=0' coords='1,2,367,28' />
<area shape='rect' href='http://services.google.com/feedback/abg' coords='384,10,453,23'/></map>
<img usemap='#google_ad_map_1715_d90684ce2261b3c9' border='0' src='http://imageads.googleadservices.com/pagead/ads?format=468x30_aff_img&amp;client=&amp;channel=&amp;output=png&amp;cuid=1715&amp;url= http%3A%2F%2Fwww.netvivs.com%2Fcreate-a-url-in-yii-without-a-link%2F' /></p>]]></content:encoded>
			<wfw:commentRss>http://www.netvivs.com/create-a-url-in-yii-without-a-link/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

