<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-4920427582902542838</id><updated>2012-01-30T00:18:57.311+05:30</updated><category term='BBC'/><category term='Windows 2003'/><category term='Stratos'/><category term='Novell'/><category term='Amazon'/><category term='WAR'/><category term='posterous'/><category term='WebLogic'/><category term='RSA'/><category term='IGF'/><category term='Identity'/><category term='Identity Server 3.2.0'/><category term='TCP'/><category term='OSCON'/><category term='WebSEAL'/><category term='Carbon 3.2.0'/><category term='iPod'/><category term='Samisa'/><category term='Carbon 3.1.0'/><category term='Mac'/><category term='GPG'/><category term='Digital Identity'/><category term='Online Payments'/><category term='JMS'/><category term='SourceForge'/><category term='Identity Server 2.0'/><category term='Apache'/><category term='Java script'/><category term='Private Key'/><category term='EC2'/><category term='SSLStrip'/><category term='News'/><category term='Federation'/><category term='2-legged OAuth'/><category term='Data Services'/><category term='MySQL'/><category term='Web Services'/><category term='Reverse proxy'/><category term='WS-Trust'/><category term='Axis2 1.5'/><category term='XML'/><category term='Tips'/><category term='Hashing'/><category term='Kerberos'/><category term='MySpace'/><category term='Blogger'/><category term='Big Data'/><category term='SAML'/><category term='CardSpace'/><category term='OpenID'/><category term='LDAP'/><category term='Security Patterns'/><category term='Security Policy'/><category term='Tomcat'/><category term='Life'/><category term='RSA Interop'/><category term='IITC'/><category term='iPhone'/><category term='Firefox'/><category term='Stonehenge'/><category term='Tech Videos'/><category term='Identity Server 3.2.2'/><category term='XACML'/><category term='WSF/PHP'/><category term='WSO2Con2011'/><category term='Esper'/><category term='WAMP'/><category term='Identity Server'/><category term='Secure Conversation'/><category term='Unix'/><category term='Cryptography'/><category term='Phishing'/><category term='Twitter'/><category term='Microsoft'/><category term='Axis2 1.4.1'/><category term='OAuth'/><category term='ESB'/><category term='Savan'/><category term='DZone'/><category term='Identity Solution'/><category term='CA'/><category term='OpenSSL'/><category term='Tomact'/><category term='OAuth 2.0'/><category term='Carbon 3.0.x'/><category term='RPC'/><category term='Security'/><category term='SOA'/><category term='WSO2'/><category term='eDirectory'/><category term='Ruchith'/><category term='Mashup'/><category term='FIX'/><category term='STS'/><category term='JAX-RPC'/><category term='Chrome'/><category term='JKS'/><category term='Knopflerfish'/><category term='BPS'/><category term='Certificates'/><category term='Rampart'/><category term='JAX-WS'/><category term='SSL'/><category term='Identity Server 3.0'/><category term='JSON'/><category term='Facebook'/><category term='Yahoo'/><category term='Cloud'/><category term='Zermatt'/><category term='Eventing'/><category term='Mooshup'/><category term='OSGi'/><category term='Governance'/><category term='REST'/><category term='GoDadday'/><category term='Webinar'/><category term='Security Gateway'/><category term='GlassFish'/><category term='Synapse'/><category term='WS-Security'/><category term='WSAS'/><category term='Carbon 2.0.x'/><category term='S3'/><category term='Java'/><category term='Keystore'/><category term='Registry'/><category term='Algorithms'/><category term='Google'/><category term='Open Source'/><category term='CouldFront'/><category term='arpspoof'/><category term='JRPC'/><category term='SOAP'/><category term='X.509'/><category term='PHP'/><category term='Passport'/><category term='Carbon'/><category term='WCF'/><category term='Carbon 3.2.2'/><category term='Active Directory'/><category term='Workshops'/><category term='Yahoo OpenID'/><category term='Tools'/><category term='IE'/><category term='Patterns'/><category term='OpenIDInfoCard'/><category term='LTTE'/><category term='ApacheCon'/><category term='iPad'/><category term='SVN'/><category term='XRI'/><category term='InfoCard'/><category term='Axis2'/><category term='PAPE'/><title type='text'>F a c i l e L o g i n</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default?start-index=101&amp;max-results=100'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>289</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-1617590413005936433</id><published>2011-12-22T19:43:00.025+05:30</published><updated>2011-12-30T15:58:46.015+05:30</updated><title type='text'>#Numbers 2011</title><content type='html'>&lt;img border="0" height="168" src="http://2.bp.blogspot.com/-ufoIFaP_Qko/TvN1KdVLxII/AAAAAAAAA0M/f6trOoffM5A/s640/Screen%2Bshot%2B2011-12-22%2Bat%2B11.49.54%2BPM.png" width="640" /&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;/tr&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;Population&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;World Population by end of 2011 is 7 Billion.&lt;/li&gt;&lt;li&gt;Population in China is 1.3 Billion.&lt;/li&gt;&lt;li&gt;Population in India is 1.19 Billion.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;/tr&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;Facebook&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;800 Million users by the end of 2011.&lt;/li&gt;&lt;li&gt;Expenses, 1 Billion US $ per year.&lt;/li&gt;&lt;li&gt;3000 employees.&lt;/li&gt;&lt;li&gt;10% of people have less than 10 friends, 20% have less than 25 friends, while 50% have over 100 friends.&lt;/li&gt;&lt;li&gt;Facebook's Datawarehousing Hadoop cluster gets 12 TB of compressed data per day, 800 TB of compressed data scanned per day, 25,000 map-reduce jobs per day, 65 millions files in HDFS and 30,000 simultaneous clients to the HDFS NameNode&lt;/li&gt;&lt;li&gt;Stores over 320 billion images, which translates to over 25 petabytes of data&lt;/li&gt;&lt;li&gt;Users upload one billion new photos (~60 terabytes) each week&lt;/li&gt;&lt;li&gt;In June 2011, Facebook hit one trillion page views that month, with 870 million unique visitors for the same period, giving the site a staggering 46.9% reach among all web surfers.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;/tr&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;Microsoft&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;330 Million Hotmail users.&lt;/li&gt;&lt;li&gt;90,000 employees.&lt;/li&gt;&lt;li&gt;Bought Skype for $8.5 Billion.&lt;/li&gt;&lt;li&gt;In June 2011, Microsoft hit with 250 million unique visitors, giving the site a 14.5% reach among all web surfers.&lt;/li&gt;&lt;li&gt;In June 2011, MSN hit with 440 million unique visitors, giving the site a 25.8% reach among all web surfers.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;/tr&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;Google&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;260 Million GMail users.&lt;/li&gt;&lt;li&gt;62 Million Google+ users.&lt;/li&gt;&lt;li&gt;31,000 employees.&lt;/li&gt;&lt;li&gt;Britney Spears has the highest number of followers in Google+ with 1,096,945 followers while Larry Page is the second.&lt;/li&gt;&lt;li&gt;In June 2011, YouTube hit with 800 million unique visitors, giving the site a 46.8% reach among all web surfers.&lt;/li&gt;&lt;li&gt;In June 2011, Blogspot hit with 340 million unique visitors, giving the site a 19.6% reach among all web surfers.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;/tr&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;Twitter&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;250 Million Tweets per day.&lt;/li&gt;&lt;li&gt;100 Million users.&lt;/li&gt;&lt;li&gt;400 employees.&lt;/li&gt;&lt;li&gt;In June 2011, Twitter hit with 160 million unique visitors, giving the site a 9.3% reach among all web surfers.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;/tr&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;Yahoo&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;302 Million users.&lt;/li&gt;&lt;li&gt;14,000 employees.&lt;/li&gt;&lt;li&gt;42,000 nodes in the Hadoop cluster.&lt;/li&gt;&lt;li&gt;Flickr stores more than 5 Billion photos.&lt;/li&gt;&lt;li&gt;Flickr gets 100,000 queries per second.&lt;/li&gt;&lt;li&gt;In June 2011, Yahoo hit with 590 million unique visitors, giving the site a 34.4% reach among all web surfers.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr&gt; &lt;/tr&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;&lt;b&gt;&amp;nbsp;&amp;nbsp;Apple&lt;/b&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;ul&gt;&lt;li&gt;61,000 employees.&lt;/li&gt;&lt;li&gt;500,000+ apps available in Apple App Store&lt;/li&gt;&lt;li&gt;18,000,000,000 downloads from the Apple App Store&lt;/li&gt;&lt;li&gt;iTunes Store had 225 million active users by June 2011&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-1617590413005936433?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/1617590413005936433/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=1617590413005936433' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1617590413005936433'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1617590413005936433'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/12/numbers-2011.html' title='#Numbers 2011'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-ufoIFaP_Qko/TvN1KdVLxII/AAAAAAAAA0M/f6trOoffM5A/s72-c/Screen%2Bshot%2B2011-12-22%2Bat%2B11.49.54%2BPM.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-344873755064532305</id><published>2011-12-21T02:37:00.006+05:30</published><updated>2011-12-21T03:45:57.432+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSO2'/><title type='text'>WSO2 Secuity Team - all back in Colombo office to celebrate Christmas</title><content type='html'>2011 was a very busy year for WSO2 and specially for the Security team. We have 6 members in the team and it was hardly found a day all six were in Colombo WSO2 office...&lt;br /&gt;&lt;br /&gt;Thilina was in Denmark in March for a customer engagement. In May he was in Switzerland and in July Thilina was in Denver for Cloud Identity conference. In November he was in Sweeden for another customer engagement.&lt;br /&gt;&lt;br /&gt;Amila was in California from February to April. And back in US, in Raleigh, NC in September for a customer engagement. In October he was in New York for another customer engagement.&lt;br /&gt;&lt;br /&gt;Asela was out during March/April for a customer engagement in North Carolina. In July Asela was in Denver for Cloud Identity conference and in New York once again for a customer engagement. In August he was at WSO2 Palo Alto office and did the Could Security workshop there with Asanka and me. Again in November he left to San Diego for a customer engagement. Just after one week he returned back to SL - he left to Germany for another customer engagement.&lt;br /&gt;&lt;br /&gt;Hasini was out of the country in June - for a customer engagement in Indianapolis.&lt;br /&gt;&lt;br /&gt;Manjula was in Thailiand in November to present WSO2 Identity Server at APICTA. And he left to Germany soon after that for a customer engagement - which finished in December. &lt;br /&gt;&lt;br /&gt;I was in New York, Washington &amp; Dallas in March for the WSO2 SOA Security &amp; Identity Workshops and in July was in Denver for Cloud Identity conference and in New York once again for a customer engagement. In August I was at WSO2 Palo Alto office and did the Could Security workshop there with Asanka and Asela. Once again I was back in New York in October for another customer engagement and also for a workshop on Cloud Security. In November I was in Vancouver - Canada for the ApacheCon.&lt;br /&gt;&lt;br /&gt;It's great to see the entire team is back in Colombo, by the end of the year...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-344873755064532305?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/344873755064532305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=344873755064532305' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/344873755064532305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/344873755064532305'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/12/wso2-secuity-team-all-back-in-colombo.html' title='WSO2 Secuity Team - all back in Colombo office to celebrate Christmas'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-1102106090218361373</id><published>2011-12-20T14:14:00.020+05:30</published><updated>2011-12-20T17:21:05.520+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='OAuth'/><category scheme='http://www.blogger.com/atom/ns#' term='2-legged OAuth'/><category scheme='http://www.blogger.com/atom/ns#' term='OAuth 2.0'/><title type='text'>2-legged OAuth with OAuth 1.0 and 2.0</title><content type='html'>&lt;a href="http://oauth.net/core/1.0/"&gt;OAuth 1.0&lt;/a&gt; emerged from the large social providers like Facebook, Yahoo!, AOL, and Google. Each had developed its own alternative to the password anti-pattern. OAuth 1.0 reflected their agreement on a single community standard.&lt;br /&gt;&lt;br /&gt;In 2009, an attack on OAuth 1.0 was identified which relied on an attacker initiating the OAuth authorization sequence, and then convincing a victim to finish the sequence – a result of which would be the attacker’s account at an (honest) client being assigned permissions to the victim’s resources at an (honest) RS. &lt;br /&gt;&lt;br /&gt;&lt;a href="http://oauth.net/core/1.0a/"&gt;OAuth 1.0a&lt;/a&gt; was the revised specification version that mitigated the attack.&lt;br /&gt;&lt;br /&gt;In 2009, recognizing the value of more formalized standardization, that community contributed OAuth 1.0 to the IETF. It was within the IETF Working Group that the original OAuth 1.0 was reworked and clarified to become the Informative &lt;a href="http://tools.ietf.org/html/rfc5849"&gt;RFC 5849&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;img border="0" height="334" src="http://1.bp.blogspot.com/-E6_Gl8XRvC0/TvA4boCsvfI/AAAAAAAAA0A/dIXtwDeDXPk/s640/Screen%2Bshot%2B2011-12-20%2Bat%2B12.30.58%2BPM.png" width="640" /&gt;&lt;br /&gt;&lt;br /&gt;In 2010, Microsoft, Yahoo!, and Google created the Web Resource Authentication Protocol (WRAP), which was soon submitted into the IETF WG as input for OAuth 2.0. WRAP proposed significant reworking of the OAuth 1.0a model. &lt;br /&gt;&lt;br /&gt;Among the changes were the deprecation of message signatures in favor of SSL, and a formal separation between the roles of ‘token issuance’ and ‘token reliance.’&lt;br /&gt;&lt;br /&gt;Development of &lt;a href="http://tools.ietf.org/html/draft-ietf-oauth-v2-22"&gt;OAuth 2.0&lt;/a&gt; in the IETF consequently reflects the input of both OAuth 1.0, OAuth 1.0a, and the WRAP proposal. It is fair to say that the very different assumptions about what are appropriate security protections between OAuth 1.0a and WRAP have created tensions within the IETG OAuth WG.&lt;br /&gt;&lt;br /&gt;While &lt;a href="http://tools.ietf.org/html/draft-ietf-oauth-v2-22"&gt;OAuth 2.0&lt;/a&gt; initially reflected more of the WRAP input, lately (i.e. fall 2010) there has been a swing in group consensus that the signatures of OAuth 1.0a that were deprecated by WRAP are appropriate and desirable in some situations. Consequently, signatures are to be added back as an optional security mechanism.&lt;br /&gt;&lt;br /&gt;While many deployments of OAuth 1.0a survive, more and more &lt;a href="http://tools.ietf.org/html/draft-ietf-oauth-v2-22"&gt;OAuth 2.0&lt;/a&gt; deployments are appearing – necessarily against a non-final version of the spec. For instance, Facebook, Salesforce, and Microsoft Azure ACS all use draft 10 of OAuth 2.0.&lt;br /&gt;&lt;br /&gt;[The above paragraphs are direct extracts from the &lt;a href="https://www.pingidentity.com/support-and-downloads/downloads/571EB52D-C293-2D59-ACD21EA90DDDD32B/The-Essentials-of-OAuth.pdf"&gt;white-paper&lt;/a&gt; published by Ping Identity on OAuth]&lt;br /&gt;&lt;br /&gt;OAuth provides a method for clients to access server resources on behalf of a resource owner (such as a different client or an end-user).  It also provides a process for end-users to authorize third-party access to their server resources without sharing their credentials (typically, a username and password pair), using user-agent redirections.&lt;br /&gt;&lt;br /&gt;In the traditional client-server authentication model, the client requests an access restricted resource (protected resource) on the server by authenticating with the server using the resource owner's credentials.  In order to provide third-party applications access to restricted resources, the resource owner shares its credentials with the third-party. This creates several problems and limitations.&lt;br /&gt;&lt;br /&gt;1. Third-party applications are required to store the resource owner's credentials for future use, typically a password in clear-text.&lt;br /&gt;&lt;br /&gt;2. Servers are required to support password authentication, despite the security weaknesses created by passwords.&lt;br /&gt;&lt;br /&gt;3. Third-party applications gain overly broad access to the resource owner's protected resources, leaving resource owners without any ability to restrict duration or access to a limited subset of resources.&lt;br /&gt;&lt;br /&gt;4. Resource owners cannot revoke access to an individual third-party without revoking access to all third-parties, and must do so by changing their password.&lt;br /&gt;&lt;br /&gt;5. Compromise of any third-party application results in compromise of the end-user's password and all of the data protected by that password.&lt;br /&gt;&lt;br /&gt;OAuth addresses these issues by introducing an authorization layer and separating the role of the client from that of the resource owner.&lt;br /&gt;&lt;br /&gt;The protocol centers on a three-legged scenario, delegating User access to a Consumer for resources held by a Service Provider. In many cases, a two-legged scenario is needed, in which the &lt;b&gt;Consumer is acting on behalf of itself&lt;/b&gt;, without a direct or any User involvement.&lt;br /&gt;&lt;br /&gt;OAuth was created to solve the problem of sharing two-legged credentials in three-legged situations. However, within the OAuth context, Consumers might still need to communicate with the Service Provider using requests that are Consumer-specific. Since the Consumers already established a Consumer Key and Consumer Secret, there is value in being able to use them for requests where the Consumer identity is being verified.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://oauth.googlecode.com/svn/spec/ext/consumer_request/1.0/drafts/2/spec.html"&gt;This specification&lt;/a&gt; defines how 2-legged OAuth works with OAuth 1.0. But it never became an IETF RFC.&lt;br /&gt;&lt;br /&gt;With OAuth 1.0 - 2-legged OAuth includes two parties. The consumer and the service provider. Basically in this case consumer also becomes the resource owner. Consumer first needs to register a consumer_key and consumer_secret with the service provider. To access a Protected Resource, the Consumer sends an HTTP(S) request to the Service Provider's resource endpoint URI. The request MUST be signed as defined in OAuth Core 1.0 section 9 with an empty Token Secret.&lt;br /&gt;&lt;br /&gt;All the requests to the Protected Resources MUST be signed by the Consumer and verified by the Service Provider. The purpose of signing requests is to prevent unauthorized parties from using the Consumer Key when making Protected Resources requests. The signature process encodes the Consumer Secret into a verifiable value which is included with the request.&lt;br /&gt;&lt;br /&gt;OAuth does not mandate a particular signature method, as each implementation can have its own unique requirements. The protocol defines three signature methods: HMAC-SHA1, RSA-SHA1, and PLAINTEXT, but Service Providers are free to implement and document their own methods.&lt;br /&gt;&lt;br /&gt;The Consumer declares a signature method in the oauth_signature_method parameter, generates a signature, and stores it in the oauth_signature parameter. The Service Provider verifies the signature as specified in each method. When verifying a Consumer signature, the Service Provider SHOULD check the request nonce to ensure it has not been used in a previous Consumer request.&lt;br /&gt;&lt;br /&gt;The signature process MUST NOT change the request parameter names or values, with the exception of the oauth_signature parameter.&lt;br /&gt;&lt;br /&gt;2-legged OAuth with OAuth 1.0  - the request to the protected resource will look like following.&lt;br /&gt;&lt;pre class="html" name="code"&gt;http://provider.example.net/profile&lt;br /&gt;            Authorization: OAuth realm="http://provider.example.net/",&lt;br /&gt;            oauth_consumer_key="dpf43f3p2l4k3l03",&lt;br /&gt;            oauth_signature_method="HMAC-SHA1",&lt;br /&gt;            oauth_signature="IxyYZfG2BaKh8JyEGuHCOin%2F4bA%3D",&lt;br /&gt;            oauth_timestamp="1191242096",&lt;br /&gt;            oauth_token="",&lt;br /&gt;            oauth_nonce="kllo9940pd9333jh",&lt;br /&gt;            oauth_version="1.0"&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;a href="http://pathberiya.blogspot.com/2011/02/2-legged-oauth-to-secure-restful.html"&gt;This&lt;/a&gt; blog post explains with an example, how to use 2-legged OAuth with OAuth 1.0 to secure RESTful service.&lt;br /&gt;&lt;br /&gt;Now, let's look at OAuth 2.0 - still at the stage of a draft specification. This doesn't talk about 2-legged OAuth. But - it can be implemented with different approaches suggested in OAuth 2.0.&lt;br /&gt;&lt;br /&gt;Have a look at &lt;a href="http://www.ietf.org/mail-archive/web/oauth/current/msg07957.html"&gt;this&lt;/a&gt; &amp; &lt;a href="http://www.ietf.org/mail-archive/web/oauth/current/msg06218.html"&gt;this&lt;/a&gt; - both talk about how to implement 2-legged OAuth with OAuth 2.0 - and those discussions are from the OAuth 2.0 IETF work group.&lt;br /&gt;&lt;br /&gt;OAuth 2.0 defines four roles:&lt;br /&gt;&lt;br /&gt;1. resource owner : An entity capable of granting access to a protected resource (e.g. end-user).&lt;br /&gt;&lt;br /&gt;2. resource server : The server hosting the protected resources, capable of accepting and responding to protected resource requests using access tokens.&lt;br /&gt;&lt;br /&gt;3. client : An application making protected resource requests on behalf of the resource owner and with its authorization.&lt;br /&gt;&lt;br /&gt;4. authorization server : The server issuing access tokens to the client after successfully authenticating the resource owner and obtaining authorization.&lt;br /&gt;&lt;br /&gt;In case of 2-legged OAuth, client becomes the resource owner.&lt;br /&gt;&lt;br /&gt;We can at very high-level break the full OAuth flow in to two parts.&lt;br /&gt;&lt;br /&gt;1. Get a token from the authorization server&lt;br /&gt;2. Use the token to access the resource server&lt;br /&gt;&lt;br /&gt;Let's see how the above two steps work under 2-legged OAuth.&lt;br /&gt;&lt;br /&gt;OAuth 2.0 defines a concept called - "authorization grant" - which is a credential representing the resource owner's authorization (to access its protected resources) used by the client to obtain an access token. This specification defines four grant types.&lt;br /&gt;&lt;br /&gt;1. authorization code&lt;br /&gt;2. implicit&lt;br /&gt;3. resource owner password credentials&lt;br /&gt;4. client credentials&lt;br /&gt;&lt;br /&gt;"Client Credentials" is the grant type which goes closely with 2-legged OAuth.&lt;br /&gt;&lt;br /&gt;With "Client Credentials" grant type, the client can request an access token using only its client credentials (or other supported means of authentication) when the client is requesting access to the protected resources under its control.&lt;br /&gt;&lt;br /&gt;Once the client makes this request to the authorization server - it will return back an access token to access the protected resource.&lt;br /&gt;&lt;br /&gt;The access token returned back to the client could be either of type bearer of MAC. &lt;br /&gt;&lt;br /&gt;The "mac" token type defined in &lt;a href="http://tools.ietf.org/html/draft-ietf-oauth-v2-http-mac-00"&gt;ietf-oauth-v2-http-mac&lt;/a&gt; is utilized by issuing a MAC key together with the access token which is used to sign certain components of the HTTP requests by the client when accessing the protected resource.&lt;br /&gt;&lt;br /&gt;The MAC scheme requires the establishment of a shared symmetric key between the client and the server.  This is often accomplished through a manual process such as client registration.&lt;br /&gt;&lt;br /&gt;The OAuth 2.0 specification offers two methods for issuing a set of MAC credentials to the client using..&lt;br /&gt;&lt;br /&gt;1. OAuth 2.0 in the form of a MAC-type access token, using any supported OAuth grant type. [This is what we discussed above - an access token with 'MAC' type]&lt;br /&gt;&lt;br /&gt;2. The HTTP "Set-Cookie" response header field via an extension attribute.&lt;br /&gt;&lt;br /&gt;When using MAC type access tokens with 2-legged OAuth - the request to the protected resource will look like following.&lt;br /&gt;&lt;pre class="html" name="code"&gt;GET /resource/1?b=1&amp;a=2 HTTP/1.1&lt;br /&gt;     Host: example.com&lt;br /&gt;     Authorization: MAC id="h480djs93hd8",&lt;br /&gt;                        nonce="264095:dj83hs9s",&lt;br /&gt;                        mac="SLDJd4mg43cjQfElUs3Qub4L6xE="&lt;br /&gt;&lt;/pre&gt;Bearer type is defined &lt;a href="http://tools.ietf.org/html/draft-ietf-oauth-v2-bearer-08"&gt;here&lt;/a&gt;. It's a security token with the property that any party in possession of the token (a "bearer") can use the token in any way that any other party in possession of it can.  Using a bearer token does not require a bearer to prove possession of cryptographic key material (proof-of-possession).&lt;br /&gt;&lt;br /&gt;When using Bearer type access tokens with 2-legged OAuth - the request to the protected resource will look like following.&lt;br /&gt;&lt;pre class="html" name="code"&gt;GET /resource HTTP/1.1&lt;br /&gt;   Host: server.example.com&lt;br /&gt;   Authorization: Bearer vF9dft4qmT&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Also - the issued access token from the Authorization Server to the client, has an 'scope' attribute. [2-legged OAuth with OAuth 1.O doesn't have this scope attribute as well as  access token concept - so resource server has to perform authorization separately based on the resource client going to access]&lt;br /&gt;&lt;br /&gt;The client should request access tokens with the minimal scope and lifetime necessary.  The authorization server will take the client identity into account when choosing how to honor the requested scope and lifetime, and may issue an access token with a less rights than requested.&lt;br /&gt;&lt;br /&gt;When securing APIs with OAuth - this 'scope' attribute can be bound to different APIs. So, the authorization server can decide whether to let the client access this API or not.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-1102106090218361373?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/1102106090218361373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=1102106090218361373' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1102106090218361373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1102106090218361373'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/12/2-legged-oauth-with-oauth-10-and-20.html' title='2-legged OAuth with OAuth 1.0 and 2.0'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-E6_Gl8XRvC0/TvA4boCsvfI/AAAAAAAAA0A/dIXtwDeDXPk/s72-c/Screen%2Bshot%2B2011-12-20%2Bat%2B12.30.58%2BPM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-8769579967147881415</id><published>2011-12-16T11:20:00.005+05:30</published><updated>2011-12-16T15:38:16.033+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='DZone'/><title type='text'>The first Kolamba DZone Community Meetup</title><content type='html'>We successfully completed the first Kolamba DZone meetup with 5O+ attendees from WSO2, University of Moratuwa, University of Colombo, Informatics and IFS.&lt;br /&gt;&lt;br /&gt;We started the event by introducing DZone - since some guys were new to it..&lt;br /&gt;&lt;br /&gt;Then we had a very interesting panel discussion on Big Data - which was followed by a demo.. and we ended up with some music.. and some 'nice' food.. Hope everyone enjoyed..&lt;br /&gt;&lt;br /&gt;&lt;img border="0" height="427" src="http://4.bp.blogspot.com/-zU2C4hxuE-o/TurbKAJvLJI/AAAAAAAAAzA/eMc2ib81pSA/s640/DSC_0041.JPG" width="640" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img border="0" height="428" src="http://3.bp.blogspot.com/-Gh_TyP3Qxk0/TurbKSXNKeI/AAAAAAAAAzM/5-7kbYuEupc/s640/DSC_0193.JPG" width="640" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img border="0" height="428" src="http://2.bp.blogspot.com/-HDMivfo0gCg/TurbLMjJa1I/AAAAAAAAAzY/qAtttdg4sJo/s640/DSC_0267.JPG" width="640" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img border="0" height="428" src="http://2.bp.blogspot.com/-dTDB4dF8BIQ/TurbLahoU7I/AAAAAAAAAzg/hBJ4UoGUlJ0/s640/DSC_0311.JPG" width="640" /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img border="0" height="428" src="http://4.bp.blogspot.com/-MvPxbE_9yPg/TurbLmiBY4I/AAAAAAAAAz0/c8M6rDlCdS8/s640/DSC_0160.JPG" width="640" /&gt;&lt;br /&gt;&lt;br /&gt;Thanks a lot WSO2 for sponsoring this event.. and thanks DZone for helping us to make this event a success..&lt;br /&gt;&lt;br /&gt;Also thanks Srinath, Tharindu, Senaka, Wathsala, Deep, Shankar, Anjana and Buddhika for taking part in the panel discussion..&lt;br /&gt;&lt;br /&gt;Thank you very much Pradeeban, Udedhika, Flora for your help in different aspects...&lt;br /&gt;&lt;br /&gt;Thanks Charitha, Dassa, Chamara, ChamaraA for the wonderful performance at the end of the event...&lt;br /&gt;&lt;br /&gt;At last , not least thanks a lot Harindu for owning everything and making everything perfect..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-8769579967147881415?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/8769579967147881415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=8769579967147881415' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8769579967147881415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8769579967147881415'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/12/first-kolamba-dzone-community-meetup.html' title='The first Kolamba DZone Community Meetup'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-zU2C4hxuE-o/TurbKAJvLJI/AAAAAAAAAzA/eMc2ib81pSA/s72-c/DSC_0041.JPG' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-345267380896135231</id><published>2011-12-15T01:37:00.022+05:30</published><updated>2011-12-15T22:27:06.596+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Big Data'/><title type='text'>A SMALL cross-section of BIG Data</title><content type='html'>Big data is a term applied to data sets whose size is beyond the ability of commonly used software tools to capture, manage, and process the data within a tolerable elapsed time. Big data sizes are a constantly moving target currently ranging from a few dozen terabytes to many petabytes of data in a single data set.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.idc.com/"&gt;IDC&lt;/a&gt; estimated the digital universe to be around 1.8 zettabytes by 2011.&lt;br /&gt;&lt;br /&gt;How big is a zettabyte? It's one billion terabytes. The current world population is 7 billion - that is, if you give a hard disk of 250 billion GB for each person on the earth - still that storage won't be sufficient.&lt;br /&gt;&lt;br /&gt;Many sources contribute to this flood of data...&lt;br /&gt;&lt;br /&gt;1. The New York Stock Exchange generates about one terabyte of new trade data per day.&lt;br /&gt;2. Facebook hosts approximately 10 billion photos taking up one petabytes of storage.&lt;br /&gt;3. Ancestry.com, the genealogy site, store around 2.5 petabytes of data.&lt;br /&gt;4. The Internet Archive stores around 2 petabytes of data, and is growing at a rate of 20 terabytes per month.&lt;br /&gt;5. The Large Harden Collider near Geneva will produce about 15 petabytes of data per year.&lt;br /&gt;6. Everyday people create the equivalent of 2.5 trillion bytes of data from sensors, mobile devices, online transactions &amp;amp; social networks.&lt;br /&gt;&lt;br /&gt;Facebook, Yahoo! and Google found themselves collecting data on an unprecedented scale.  They were the first massive companies collecting tons of data from millions of users.&lt;br /&gt;&lt;br /&gt;They quickly overwhelmed traditional data systems and techniques like Oracle and MySql.  Even the best, most expensive vendors using the biggest hardware could barely keep up and certainly couldn’t give them tools to powerfully analyze their influx of data.&lt;br /&gt;&lt;br /&gt;In the early 2000’s they developed new techniques like &lt;a href="http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en//archive/mapreduce-osdi04.pdf"&gt;MapReduce&lt;/a&gt;, &lt;a href="http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en//archive/bigtable-osdi06.pdf"&gt;BigTable&lt;/a&gt; and &lt;a href="http://www.cs.brown.edu/courses/cs295-11/2006/gfs.pdf"&gt;Google File System&lt;/a&gt; to handle their big data. Initially these techniques were held proprietary. But they realized making the concepts public, while keeping the implementations hidden, will benefit them - since more people will contribute to those and the graduates they hire will have a good understanding prior to joining. &lt;br /&gt;&lt;br /&gt;Around 2004/2005 Facebook, Yahoo! and Google started sharing research papers describing their big data technologies.&lt;br /&gt;&lt;br /&gt;In 2004 Google published the research paper "MapReduce: Simplified Data Processing on Large Clusters".&lt;br /&gt;&lt;br /&gt;MapReduce is a programming model and an associated implementation for processing and generating large data sets. Users specify a map function that processes a key/value pair to generate a set of intermediate key/value pairs, and a reduce function that merges all intermediate values associated with the same intermediate key. Many real world tasks are expressible in this model, as shown in &lt;a href="http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en//archive/mapreduce-osdi04.pdf"&gt;this&lt;/a&gt; paper.&lt;br /&gt;&lt;br /&gt;Programs written in this functional style are automatically parallelized and executed on a large cluster of commodity machines. The run-time system takes care of the details of partitioning the input data, scheduling the program's execution across a set of machines, handling machine failures, and managing the required inter-machine communication. This allows programmers without any experience with parallel and distributed systems to easily utilize the resources of a large distributed system. Google's implementation of MapReduce runs on a large cluster of commodity machines and is highly scalable.&lt;br /&gt;&lt;br /&gt;A typical MapReduce computation processes many terabytes of data on thousands of machines. Programmers and the system easy to use. Hundreds of MapReduce programs have been implemented and upwards of one thousand MapReduce jobs are executed on Google's clusters every day.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Doug_Cutting"&gt;Doug Cutting&lt;/a&gt; who worked for &lt;a href="http://www.nutch.org/"&gt;Nutch&lt;/a&gt;, an open-source search technology project which are now managed through the Apache Software Foundation, read this paper published by Google and also another &lt;a href="http://www.cs.brown.edu/courses/cs295-11/2006/gfs.pdf"&gt;paper&lt;/a&gt; published by Google on Google's distributed file system [GFS]. He figured out GFS will solve their storage needs and MapReduce will solve the scaling issues they encountered with Nutch and implemented MapReduce and GFS. They named the GFS implementation for Nutch as the Nutch Distributed Filesystem [NDFS].&lt;br /&gt;&lt;br /&gt;NDFS and the MapReduce implementation in Nutch were applicable beyond the realm of search, and in February 2006 they moved out of Nutch to form an independent sub project of Lucene called Hadoop and NDFS, became &lt;a href="http://storageconference.org/2010/Papers/MSST/Shvachko.pdf"&gt;HDFS&lt;/a&gt; [Hadoop Distributed File System] - which is an implementation of GFS. During the same time Yahoo! extended their support for Hadoop and hired Doug Cutting.&lt;br /&gt;&lt;br /&gt;&lt;img border="0" height="243" src="http://4.bp.blogspot.com/--VFn6srnpvg/TuomrODHY3I/AAAAAAAAAy0/CEgLSy2YmW0/s640/Screen%2Bshot%2B2011-12-15%2Bat%2B10.23.51%2BPM.png" width="640" /&gt;&lt;br /&gt;&lt;br /&gt;At a very high-level, this is how HDFS works. Say we have a 300 MB file. [Hadoop also does really well with files of petabytes and terabytes.] The first thing HDFS is going to do is to split this up in to blocks. The default block size on HDFS right now is 128 MB. Once split-ed in to blocks we will have two blocks of 128 MB and another of 44 MB. Now HDFS will make 'n' number of ['n' is configurable - say 'n' is three] copies/replicas of each of these blocks. HDFS will now store these replicas in different DataNodes of the HDFS cluster. We also have a single NameNode, which keeps track of replicas and the DataNodes. NameNode knows where a given replica resides - whenever it detects a given replica is corrupted [DataNode keeps on running checksums on replicas] or the corresponding HDFS node is dowm, it will find out where else that replica is in the cluster and tells other nodes do 'n'X replication of that replica. The NameNode is a single point of failure - and two avoid that we can have secondary NameNode which in sync with the primary -and when primary is down - the secondary can take control. Hadoop project is currently working on implementing distributed NameNodes.&lt;br /&gt;&lt;br /&gt;Again in 2006 Google published another paper on "Bigtable: A Distributed Storage System for Structured Data"&lt;br /&gt;&lt;br /&gt;Bigtable is a distributed storage system for managing structured data that is designed to scale to a very large size, petabytes of data across thousands of commodity servers. Many projects at Google store data in Bigtable, including web indexing, Google Earth, and Google Finance. These applications place very different demands on Bigtable, both in terms of data size (from URLs to web pages to satellite imagery) and latency requirements (from backend bulk processing to real-time data serving). Despite these varied demands, Bigtable has successfully provided a flexible, high-performance solution for all of these Google products. &lt;a href="http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en//archive/bigtable-osdi06.pdf"&gt;This&lt;/a&gt; paper  describes the simple data model provided by Bigtable, which gives clients dynamic control over data layout and format, and describes the design and implementation of Bigtable.&lt;br /&gt;&lt;br /&gt;BigTable maps two arbitrary string values (row key and column key) and timestamp (hence three dimensional mapping) into an associated arbitrary byte array. It is not a relational database and can be better defined as a sparse, distributed multi-dimensional sorted map.&lt;br /&gt;&lt;br /&gt;Basically BigTable discussed how to build a distributed data store on top of GFS.&lt;br /&gt;&lt;br /&gt;HBase by Hadoop is an implementation of BigTable. HBase is a distributed, column oriented database which is using HDFS for it's underlying storage and supports both batch-style computation using MapReduce and point queries.&lt;br /&gt;&lt;br /&gt;Amazon, published a research paper in 2007 on "Dynamo: Amazon’s Highly Available Key-value Store".&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf"&gt;Dynamo&lt;/a&gt;, is a highly available key-value storage system that some of Amazon’s core services use to provide an “always-on” experience. Apache Cassandra — brings together Dynamo's fully distributed design and BigTable's data model and written in Java - open sourced by Facebook in 2008. It is a NoSQL solution that was initially developed by Facebook and powered their Inbox Search feature until late 2010. In fact much of the initial development work on Cassandra was performed by two Dynamo engineers recruited to Facebook from Amazon. However, Facebook abandoned Cassandra in late 2010 when they built Facebook Messaging platform on HBase.&lt;br /&gt;&lt;br /&gt;Also, besides using the way of modeling of BigTable, it has properties like eventual consistency, the Gossip protocol, a master-master way of serving the read and write requests that are inspired by Amazon's Dynamo. One of the important properties, the Eventual consistency - means that given a sufficiently long period of time over which no changes are sent, all updates can be expected to propagate eventually through the system and all the replicas will be consistent. &lt;br /&gt;&lt;br /&gt;I used the term 'NoSQL' when talking about Cassandra. NoSQL (sometimes expanded to "not only SQL") is a broad class of database management systems that differ from the classic model of the relational database management system (RDBMS) in some significant ways. These data stores may not require fixed table schemas, usually avoid join operations, and typically scale horizontally. &lt;br /&gt;&lt;br /&gt;The name "NoSQL" was in fact first used by Carlo Strozzi in 1998 as the name of file-based database he was developing. Ironically it's relational database just one without a SQL interface. The term re-surfaced in 2009 when Eric Evans used it to name the current surge in non-relational databases. &lt;br /&gt;&lt;br /&gt;There are four categories of NoSQL databases.&lt;br /&gt;&lt;br /&gt;1. Key-value stores : This is based on Amazon's Dynamo paper.&lt;br /&gt;2. ColumnFamily / BigTable clones : Examples are HBase, Cassandra&lt;br /&gt;3. Document Databases : Examples are CouchDB, MongoDB&lt;br /&gt;4. Graph Database : Examples are AllegroGrapgh, Neo4j&lt;br /&gt;&lt;br /&gt;As per Marin Dimitrov, following are the use cases for NoSQL databases - in other words following are the cases where relational databases do not perform well.&lt;br /&gt;&lt;br /&gt;1. Massive Data Volumes&lt;br /&gt;2. Extreme Query Volume&lt;br /&gt;3. Schema Evolution&lt;br /&gt;&lt;br /&gt;With NoSQL, we get the advantages like, Massive Scalability, High Availability, Lower Cost (than competitive solutions at that scale), Predictable elasticity and Schema flexibility.&lt;br /&gt;&lt;br /&gt;For application programmers the major difference between relational databases and the Cassandra is &lt;a href="http://maxgrinev.com/2010/07/09/a-quick-introduction-to-the-cassandra-data-model/"&gt;it's data model&lt;/a&gt; - which is based on BigTable. The Cassandra data model is designed for distributed data on a very large scale. It trades ACID-compliant data practices for important advantages in performance, availability, and operational manageability.&lt;br /&gt;&lt;br /&gt;If you want to compare Cassandra with HBase, then &lt;a href="http://blog.adku.com/2011/02/hbase-vs-cassandra.html"&gt;this&lt;/a&gt; is a good one. Another HBase vs Cassandra debate is &lt;a href="http://stackoverflow.com/questions/7237271/large-scale-data-processing-hbase-vs-cassandra"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;References :&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;[1]: &lt;a href="http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en//archive/mapreduce-osdi04.pdf"&gt;MapReduce: Simplified Data Processing on Large Clusters&lt;/a&gt;&lt;br /&gt;[2]: &lt;a href="http://static.googleusercontent.com/external_content/untrusted_dlcp/research.google.com/en//archive/bigtable-osdi06.pdf"&gt;Bigtable: A Distributed Storage System for Structured Data&lt;/a&gt;&lt;br /&gt;[3]: &lt;a href="http://www.allthingsdistributed.com/files/amazon-dynamo-sosp2007.pdf"&gt;Dynamo: Amazon’s Highly Available Key-value Store&lt;/a&gt;&lt;br /&gt;[4]: &lt;a href="http://storageconference.org/2010/Papers/MSST/Shvachko.pdf"&gt;The Hadoop Distributed File System&lt;/a&gt;&lt;br /&gt;[5]: &lt;a href="http://www.usenix.org/event/atc10/tech/full_papers/Hunt.pdf"&gt;ZooKeeper: Wait-free coordination for Internet-scale systems&lt;/a&gt;&lt;br /&gt;[6]: &lt;a href="http://www.biomedcentral.com/1471-2105/11/S12/S1"&gt;An overview of the Hadoop/MapReduce/HBase framework and its current applications in bioinformatics&lt;/a&gt;&lt;br /&gt;[7]: &lt;a href="http://www.cs.cornell.edu/projects/ladis2009/papers/lakshman-ladis2009.pdf"&gt;Cassandra - A Decentralized Structured Storage System&lt;/a&gt;&lt;br /&gt;[8]: &lt;a href="http://horicky.blogspot.com/2009/11/nosql-patterns.html"&gt;NOSQL Patterns&lt;/a&gt;&lt;br /&gt;[9]: &lt;a href="http://horicky.blogspot.com/2010/10/bigtable-model-with-cassandra-and-hbase.html"&gt;BigTable Model with Cassandra and HBase&lt;/a&gt;&lt;br /&gt;[10]: &lt;a href="http://www.youtube.com/watch?v=SS27F-hYWfU"&gt;LinkedIn Tech Talks : Apache Hadoop - Petabytes and Terawatts&lt;/a&gt;&lt;br /&gt;[11]: &lt;a href="http://www.youtube.com/watch?v=Aq0x2z69syM"&gt;O'Reilly Webcast: An Introduction to Hadoop&lt;/a&gt;&lt;br /&gt;[12]: &lt;a href="http://www.youtube.com/watch?v=zVSSsJ_ua4Q"&gt;Google Developer Day : MapReduce&lt;/a&gt;&lt;br /&gt;[13]: &lt;a href="http://www.youtube.com/user/WSO2TechFlicks#p/u/30/Q98ru1L4hBk"&gt;WSO2Con 2011 - Panel: Data, data everywhere: big, small, private, shared, public and more&lt;/a&gt;&lt;br /&gt;[14]: &lt;a href="http://www.podcast.tv/video-episodes/peter-schuller-scaling-with-apache-cassandra-13992871.html"&gt;Scaling with Apache Cassandra&lt;/a&gt;&lt;br /&gt;[15]: &lt;a href="http://ria101.wordpress.com/2010/02/24/hbase-vs-cassandra-why-we-moved/"&gt;HBase vs Cassandra: why we moved&lt;/a&gt;&lt;br /&gt;[16]: &lt;a href="http://blog.knuthaugen.no/2010/03/a-brief-history-of-nosql.html"&gt;A Brief History of NoSQL&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-345267380896135231?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/345267380896135231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=345267380896135231' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/345267380896135231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/345267380896135231'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/12/big-data.html' title='A SMALL cross-section of BIG Data'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/--VFn6srnpvg/TuomrODHY3I/AAAAAAAAAy0/CEgLSy2YmW0/s72-c/Screen%2Bshot%2B2011-12-15%2Bat%2B10.23.51%2BPM.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-2669445988308251024</id><published>2011-12-10T14:34:00.004+05:30</published><updated>2011-12-10T18:04:45.654+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='iPad'/><title type='text'>Possible bug in iPad push notifications ?</title><content type='html'>The applications that do support push notifications - will prompt a message whenever there is something to notify - even-though the user is not using the app at that time.&lt;br /&gt;&lt;br /&gt;But - what if I have secured the iPad with a password.. Still these apps will prompt the message when iPad is in locked state.. Which looks like a bug for me.. &lt;br /&gt;&lt;br /&gt;&lt;img border="0" height="640" src="http://1.bp.blogspot.com/-ey4uMfwMfbM/TuMcWSXKldI/AAAAAAAAAyc/IV9xBxDupw4/s640/photo%2B%25282%2529.PNG" width="480" /&gt;&lt;br /&gt;Another possible bug.. when your iPad is locked and requires a password to unlock, still anyone can access your photos, just by clicking on the icon below..&lt;br /&gt;&lt;br /&gt;&lt;img border="0" height="85" src="http://3.bp.blogspot.com/-LphopBr5Ees/TuMfzjH3yiI/AAAAAAAAAyo/D618OcIKYDA/s400/Screen%2Bshot%2B2011-12-10%2Bat%2B2.29.21%2BPM.png" width="400" /&gt;&lt;br /&gt;May be iPad has some options to handle these scenarios - even in that case this  shouldn't be the default behavior when iPad is protected with a password.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-2669445988308251024?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/2669445988308251024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=2669445988308251024' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2669445988308251024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2669445988308251024'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/12/possible-bug-in-ipad-push-notifications.html' title='Possible bug in iPad push notifications ?'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-ey4uMfwMfbM/TuMcWSXKldI/AAAAAAAAAyc/IV9xBxDupw4/s72-c/photo%2B%25282%2529.PNG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-4439466978223755552</id><published>2011-12-06T19:28:00.030+05:30</published><updated>2011-12-07T22:11:45.086+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Rampart'/><category scheme='http://www.blogger.com/atom/ns#' term='WS-Security'/><title type='text'>Symmetric/Asymmetric Encryption/Signature with Apache Rampart</title><content type='html'>What is meant by Symmetric ? Both the parties, client and server use the same key to encrypt and sign.&lt;br /&gt;&lt;br /&gt;Now the question is how to establish this key..? Anyone of the two parties can generate the key, but.. how do we pass the generated key to the other end...&lt;br /&gt;&lt;br /&gt;This is how it works in Web Services security...&lt;br /&gt;&lt;br /&gt;1. Initiator generates a key&lt;br /&gt;2. Signs/Encrypts the message with the generated key&lt;br /&gt;3. Encrypts the key with the public key of the recipient&lt;br /&gt;4. Builds an encrypted key element with the output from [3] and associates an ID with that element and stores it in-memory using ID as the key. [This is how Rampart stores it] &lt;pre class="html" name="code"&gt;&amp;lt;xenc:EncryptedKey Id=&amp;quot;EncKeyId-C1AFA8321D1093CA1913231781007902&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;xenc:EncryptionMethod&lt;br /&gt;     Algorithm=&amp;quot;http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;ds:KeyInfo xmlns:ds=&amp;quot;http://www.w3.org/2000/09/xmldsig#&amp;quot;&amp;gt;&lt;br /&gt;     &amp;lt;wsse:SecurityTokenReference&amp;gt;&lt;br /&gt;      &amp;lt;wsse:KeyIdentifier&lt;br /&gt;       EncodingType=&amp;quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary&amp;quot;&lt;br /&gt;       ValueType=&amp;quot;http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1&amp;quot;&amp;gt;r3iHLvhEdbQLQGh0iuDzzJMBz40=&amp;lt;/wsse:KeyIdentifier&amp;gt;&lt;br /&gt;     &amp;lt;/wsse:SecurityTokenReference&amp;gt;&lt;br /&gt;    &amp;lt;/ds:KeyInfo&amp;gt;&lt;br /&gt;    &amp;lt;xenc:CipherData&amp;gt;&lt;br /&gt;&amp;lt;xenc:CipherValue&amp;gt;O8LF2rEFKOJfKZpWlpmHI2OopDX00Ep4koqpJuEqhPbm3do1MTSovi0ZGl6wwtXYYCr3VzHobwDoc6yAECEoCEH9ZUvnzBKXa7OqmuGl3LOhIe91sTpHdceXbq7f6MpfePMPuHsdKhkbWea3aTOzbvzRm5VctZC7K4wk0LryBMQ=&lt;br /&gt;     &amp;lt;/xenc:CipherValue&amp;gt;&lt;br /&gt;    &amp;lt;/xenc:CipherData&amp;gt;&lt;br /&gt;   &amp;lt;/xenc:EncryptedKey&amp;gt;&lt;br /&gt;&lt;/pre&gt;5. EncryptedKey element will be included in the Security header of the SOAP message going from the sender to the recipient.&lt;br /&gt;&lt;br /&gt;Here what you see under &lt;b&gt;CipherValue&lt;/b&gt; element is the encrypted generated key.&lt;br /&gt;&lt;br /&gt;The value of &lt;b&gt;KeyIdentifier&lt;/b&gt;, which is &lt;b&gt;r3iHLvhEdbQLQGh0iuDzzJMBz40=&lt;/b&gt;, is the base64 encoded SHA1 value of the fingerprint of the recipient's public key. Looking at this fingerprint value, recipient can pick the corresponding private key to decrypt the message and get the generated key out.&lt;br /&gt;&lt;br /&gt;Also, let's have a look at the &lt;b&gt;Algorithm&lt;/b&gt; attribute of &lt;b&gt;EncryptionMethod&lt;/b&gt; element. This is the algorithm used to encrypt the generated key - and which to use is based on the Algorithm Suite defined in your security policy. In this case I have used Basic256 as the Algorithm Suite - so it uses &lt;a href="http://www.w3.org/TR/2002/REC-xmlenc-core-20021210/Overview.html#rsa-oaep-mgf1p"&gt;rsa-oaep-mgf1p&lt;/a&gt; as the asymmetric key wrapping algorithm.&lt;br /&gt;&lt;br /&gt;Now let's see what happens at the recipient end...&lt;br /&gt;&lt;br /&gt;1. Recipient gets the message&lt;br /&gt;2. Finds the private key corresponding to the fingerprint value in EncryptedKey element&lt;br /&gt;3. Decrypts the encrypted generated key&lt;br /&gt;4. Decrypts the message and verifies the signature using the key from [3]&lt;br /&gt;5. Generates the response&lt;br /&gt;6. Signs/Encrypts the response from the same key from [3]&lt;br /&gt;7. Now it generates the SHA1 of the EncryptedKey element it receives from the client and adds the base64 encoded value to the response&lt;br /&gt;8. Sends the response to the client&lt;br /&gt;&lt;br /&gt;Once the client gets the message, it will perform following validations..&lt;br /&gt;&lt;br /&gt;1. Client gets the message&lt;br /&gt;2. Goes through all the stored EncryptedKey elements in-memory to check whether the SHA1 hash of any of them matches with the hash value in the response. If any match found, that's the Encrypted key.&lt;br /&gt;3. EncryptedKey element in the memory also maintains the generated key in clear text, so client can find it &lt;br /&gt;4. From the key found in [3]. client validates the message&lt;br /&gt;&lt;br /&gt;With Symmetric binding, only the recipient needed to have a public/private key pair.&lt;br /&gt;&lt;br /&gt;But in Asymmetric binding both the parties should have their own key pairs.&lt;br /&gt;&lt;br /&gt;Even it's Asymmetric, the encryption happens with a generated symmetric key - the reason is Asymmetric encryption is resource consuming and also cannot operate on a large amount of data... so, WS-Security specification recommends to use symmetric key encryption with a generated key, even with the Asymmetric binding.&lt;br /&gt;&lt;br /&gt;The major difference between the Asymmetric and the Symmetric is the way Signature been handled.&lt;br /&gt;&lt;br /&gt;With Symmetric binding, both the request and the response are signed using the same generated key.. But in Asymmetric binding, the request is signed using the sender's private key and the response is signed using recipient's private key. In other words, Asymmetric provides a guarantee on non-repudiation while Symmetric binding does not.&lt;br /&gt;&lt;br /&gt;Let's see how Asymmetric binding works in Web Services security..&lt;br /&gt;&lt;br /&gt;1. Initiator/client generates a key&lt;br /&gt;2. Encrypts the message with the generated key&lt;br /&gt;3. Signs message with it's own private key&lt;br /&gt;4. Encrypts the generated key with the public key of the recipient&lt;br /&gt;5. Builds an encrypted key element with the output from [4] and associates an ID with that element. Do NOT store it in-memory as in the case of Symmetric.&lt;pre class="html" name="code"&gt;&amp;lt;xenc:EncryptedKey Id=&amp;quot;EncKeyId-C1AFA8321D1093CA1913231781007902&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;xenc:EncryptionMethod&lt;br /&gt;     Algorithm=&amp;quot;http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;ds:KeyInfo xmlns:ds=&amp;quot;http://www.w3.org/2000/09/xmldsig#&amp;quot;&amp;gt;&lt;br /&gt;     &amp;lt;wsse:SecurityTokenReference&amp;gt;&lt;br /&gt;      &amp;lt;wsse:KeyIdentifier&lt;br /&gt;       EncodingType=&amp;quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary&amp;quot;&lt;br /&gt;       ValueType=&amp;quot;http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1&amp;quot;&amp;gt;r3iHLvhEdbQLQGh0iuDzzJMBz40=&amp;lt;/wsse:KeyIdentifier&amp;gt;&lt;br /&gt;     &amp;lt;/wsse:SecurityTokenReference&amp;gt;&lt;br /&gt;    &amp;lt;/ds:KeyInfo&amp;gt;&lt;br /&gt;    &amp;lt;xenc:CipherData&amp;gt;&lt;br /&gt;&amp;lt;xenc:CipherValue&amp;gt;O8LF2rEFKOJfKZpWlpmHI2OopDX00Ep4koqpJuEqhPbm3do1MTSovi0ZGl6wwtXYYCr3VzHobwDoc6yAECEoCEH9ZUvnzBKXa7OqmuGl3LOhIe91sTpHdceXbq7f6MpfePMPuHsdKhkbWea3aTOzbvzRm5VctZC7K4wk0LryBMQ=&lt;br /&gt;     &amp;lt;/xenc:CipherValue&amp;gt;&lt;br /&gt;    &amp;lt;/xenc:CipherData&amp;gt;&lt;br /&gt;   &amp;lt;/xenc:EncryptedKey&amp;gt;&lt;br /&gt;&lt;/pre&gt;6. EncryptedKey element will be included in the Security header of the SOAP message going from the sender to the recipient.&lt;br /&gt;&lt;br /&gt;The SOAP messages for Symmetric and Asymmetric requests look alike - cannot find any differences.&lt;br /&gt;&lt;br /&gt;Now let's see what happens at the recipient end...&lt;br /&gt;&lt;br /&gt;1. Recipient gets the message&lt;br /&gt;2. Finds the private key corresponding to the fingerprint value in EncryptedKey element&lt;br /&gt;3. Decrypts the encrypted generated key&lt;br /&gt;4. Decrypts the message using the key from [3]&lt;br /&gt;5. Verifies the signature of the message using the public key of the sender&lt;br /&gt;6. Generates the response&lt;br /&gt;7. Generates a new key&lt;br /&gt;8. Encrypts the message with the generated new key&lt;br /&gt;9. Signs message with it's own private key&lt;br /&gt;10. Encrypts the generated key with the public key of the initiator [the client]&lt;br /&gt;11. EncryptedKey element will be built with the encrypted generated key and included in the Security header of the SOAP message going from the service to the client.&lt;br /&gt;12. Sends the response to the client&lt;br /&gt;&lt;br /&gt;Once the client gets the message, it will perform following validations...&lt;br /&gt;&lt;br /&gt;1. Client gets the message&lt;br /&gt;2. Finds the private key corresponding to the fingerprint value in EncryptedKey element&lt;br /&gt;3. Decrypts the encrypted generated key with the key from [2]&lt;br /&gt;4. Decrypts the message using the key from [3]&lt;br /&gt;5. Verifies the signature of the message using the public key of the service&lt;br /&gt;&lt;br /&gt;One of my colleagues recently asked me how to find whether someone is using Asymmetric or Symmetric binding just by looking at the SOAP messages... &lt;br /&gt;&lt;br /&gt;This is not possible by looking at the SOAP request - but looking at the SOAP response we can figure it out. When using Asymmetric binding SOAP response will have the EncryptedKey element inside the Security header - but not in the case of Symmetric binding.&lt;br /&gt;&lt;br /&gt;Let's summarize the differences in the behavior between Asymmetric and Symmetric bindings.&lt;br /&gt;&lt;br /&gt;&lt;table border="1" width="100%"&gt;&lt;tr&gt; &lt;th width="20%"&gt;&lt;/th&gt; &lt;th width="40%" align="center"&gt;Symmetric Binding&lt;/th&gt; &lt;th width="40%" align="center"&gt;Asymmetric Binding&lt;/th&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td width="20%"&gt;Client&lt;/td&gt; &lt;td width="40%"&gt;Generates a key&lt;/td&gt; &lt;td width="40%"&gt;Generates a key&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td width="20%" &gt;Service&lt;/td&gt; &lt;td width="40%"&gt;Uses the same key generated from the client&lt;/td&gt; &lt;td width="40%"&gt;Generates a key&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td colspan="3" bgcolor="#7E354D"&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td width="20%"&gt;Client&lt;/td&gt; &lt;td width="40%"&gt;Stores the generated key&lt;/td&gt; &lt;td width="40%"&gt;Does NOT store the generated key&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td width="20%" &gt;Service&lt;/td&gt; &lt;td width="40%"&gt;Does not generate keys&lt;/td&gt; &lt;td width="40%"&gt;Does NOT store the generated key&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td colspan="3" bgcolor="#7E354D"&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td width="20%" &gt;Client&lt;/td&gt; &lt;td width="40%"&gt;Encrypts with the generated key&lt;/td&gt; &lt;td width="40%"&gt;Encrypts with the generated key&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td width="20%" &gt;Service&lt;/td&gt; &lt;td width="40%"&gt;Encrypts with the client generated key&lt;/td&gt; &lt;td width="40%"&gt;Encrypts with the service generated key&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td colspan="3" bgcolor="#7E354D"&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td width="20%" &gt;Client&lt;/td&gt; &lt;td width="40%"&gt;Signs with the generated key&lt;/td&gt; &lt;td width="40%"&gt;Signs with the it's own private key&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td width="20%" &gt;Service&lt;/td&gt; &lt;td width="40%"&gt;Signs with the client generated key&lt;/td&gt; &lt;td width="40%"&gt;Signs with the it's own private key&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td colspan="3" bgcolor="#7E354D"&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td width="20%" &gt;Client&lt;/td&gt; &lt;td width="40%"&gt;Adds the EncryptedKey element to the request&lt;/td&gt; &lt;td width="40%"&gt;Adds the EncryptedKey element to the request&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td width="20%" &gt;Service&lt;/td&gt; &lt;td width="40%"&gt;Does NOT add the EncryptedKey element to the response&lt;/td&gt; &lt;td width="40%"&gt;Adds the EncryptedKey element to the response&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td colspan="3" bgcolor="#7E354D"&gt;&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td width="20%" &gt;Client&lt;/td&gt; &lt;td width="40%"&gt;Signature algorithm hmac-sha1&lt;/td&gt; &lt;td width="40%"&gt;Signature algorithm rsa-sha1&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td width="20%" &gt;Service&lt;/td&gt; &lt;td width="40%"&gt;Signature algorithm hmac-sha1&lt;/td&gt; &lt;td width="40%"&gt;Signature algorithm rsa-sha1&lt;/td&gt; &lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-4439466978223755552?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/4439466978223755552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=4439466978223755552' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4439466978223755552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4439466978223755552'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/12/symmetric-encryptionsignature-with.html' title='Symmetric/Asymmetric Encryption/Signature with Apache Rampart'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-415078489127105611</id><published>2011-12-03T10:55:00.005+05:30</published><updated>2011-12-03T11:10:58.815+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSO2'/><category scheme='http://www.blogger.com/atom/ns#' term='Workshops'/><title type='text'>Creating RESTful APIs Using the WSO2 Platform</title><content type='html'>APIs have become an essential and key success factor for any business. Businesses do not operate as silos anymore, therefore each business depends on B2B communications. In technical terms, different systems/applications need to communicate with each other to fulfill various business requirements. Publishing rich business APIs is the answer to the above requirements.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/-BbxzsEmwjaM/Ttm1gv5VzJI/AAAAAAAAAyQ/D3ENfJ8PZlU/s1600/Screen%2Bshot%2B2011-12-03%2Bat%2B11.05.27%2BAM.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-BbxzsEmwjaM/Ttm1gv5VzJI/AAAAAAAAAyQ/D3ENfJ8PZlU/s1600/Screen%2Bshot%2B2011-12-03%2Bat%2B11.05.27%2BAM.png" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Architects and developers who implement APIs prefer to use REST as the standard by looking at the simplicity and flexibility it provides for the end-users of the API and use lightweight message formats like JSON and POX. Most enterprises struggle to expose RESTful APIs due to various technical limitations and spend more time to architect and implement the same.&lt;br /&gt;&lt;a href="http://wso2.com/events/workshops/2011-december-palo-alto-restful-apis-workshop/"&gt;&lt;br /&gt;This half-day workshop&lt;/a&gt; focuses on how to expose your heterogeneous back-end services as a RESTful API in a quick and easy but architecturally accurate way, using the WSO2 Platform - and presented by &lt;a href="http://asanka.abeysinghe.org/"&gt;Asanka Abeysinghe&lt;/a&gt;, Director, Solutions Architecture, WSO2.&lt;br /&gt;&lt;br /&gt;Date : Thursday, 8 December - from 9.00 AM to 1.00 PM&lt;br /&gt;Location : 4131, El Camino Real, Suite 200 Palo Alto, CA 94306&lt;br /&gt;Admission : Free&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-415078489127105611?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/415078489127105611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=415078489127105611' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/415078489127105611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/415078489127105611'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/12/creating-restful-apis-using-wso2.html' title='Creating RESTful APIs Using the WSO2 Platform'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-BbxzsEmwjaM/Ttm1gv5VzJI/AAAAAAAAAyQ/D3ENfJ8PZlU/s72-c/Screen%2Bshot%2B2011-12-03%2Bat%2B11.05.27%2BAM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-2339665033003387501</id><published>2011-12-01T16:33:00.005+05:30</published><updated>2011-12-01T18:29:53.735+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='DZone'/><title type='text'>Kolamba DZone Community Meetup</title><content type='html'>The first ever DZone meetup in Sri Lanka happens on 15th December at WSO2 #58 office..&lt;br /&gt;&lt;br /&gt;Sri Lanka has the highest number of Apace Committers out side USA and further in Google Summer of Code, University of Moratuwa - Sri Lanka was ranked as the top university Worldwide in terms of the number of awards received by students for the five year period from its inception in 2005. So, the interest among Sri Lankan tech community towards DZone Community Meetup undoubtedly expect to be very high... &lt;br /&gt;&lt;br /&gt;We have picked "Big Data" as the theme for this meetup and have invited the experts in this area to share their thoughts.. All topics related to Big Data has lots of traction these days and &lt;a href="http://dzone.com/mz/nosql"&gt;DZone NoSQL Zone&lt;/a&gt; has a good collection of resources..&lt;br /&gt;&lt;br /&gt;We would like to invite any of the DZone members/users around Colombo to join this meetup to share your thoughts..&lt;br /&gt;&lt;br /&gt;&lt;a href="http://wso2.org"&gt;WSO2&lt;/a&gt; is happily sponsoring the event and we would expect DZone to send us some RefCards to share between the attendees..&lt;br /&gt;&lt;br /&gt;Please confirm your attendance via &lt;a href="http://www.meetup.com/DZoneVIP/Kolamba-LK/537342/"&gt;http://www.meetup.com/DZoneVIP/Kolamba-LK/537342/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Location : WSO2, 5th Floor, 58 [ICIC Building], Dharmapala Mawatha, Colombo 07.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://bit.ly/vmUjFq" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-K-eoSynXhy4/TtdeljaZBLI/AAAAAAAAAyE/7PdNd62ctR0/s640/Screen%2Bshot%2B2011-12-01%2Bat%2B4.29.53%2BPM.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-2339665033003387501?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/2339665033003387501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=2339665033003387501' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2339665033003387501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2339665033003387501'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/12/kolamba-dzone-community-meetup.html' title='Kolamba DZone Community Meetup'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-K-eoSynXhy4/TtdeljaZBLI/AAAAAAAAAyE/7PdNd62ctR0/s72-c/Screen%2Bshot%2B2011-12-01%2Bat%2B4.29.53%2BPM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-4533708715547946229</id><published>2011-11-26T02:34:00.013+05:30</published><updated>2011-11-26T08:57:20.549+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SAML'/><title type='text'>The depth of SAML [SAML Summary]</title><content type='html'>1. History&lt;br /&gt;&lt;br /&gt;Security Assertion Markup Language (SAML) is an XML standard for exchanging authentication and authorization data between entities which is a product of the OASIS Security Services Technical Committee.&lt;br /&gt;&lt;br /&gt;- SAML 1.0 was adopted as an OASIS standard in Nov 2002&lt;br /&gt;- SAML 1.1 was ratified as an OASIS standard in Sept 2003&lt;br /&gt;- SAML 2.0 became an OASIS standard in Mar 2005&lt;br /&gt;&lt;br /&gt;Liberty Alliance donated its Identity Federation Framework (ID-FF) specification to OASIS, which became the basis of the SAML 2.0 specification. Thus SAML 2.0 represents the convergence of SAML 1.1, Liberty ID-FF 1.2, and Shibboleth 1.3.&lt;br /&gt;&lt;br /&gt;2. SAML base standards&lt;br /&gt;&lt;br /&gt;SAML is built upon the following technology standards.&lt;br /&gt;&lt;br /&gt;- Extensible Markup Language (XML)&lt;br /&gt;- XML Schema&lt;br /&gt;- XML Signature&lt;br /&gt;- XML Encryption (SAML 2.0 only)&lt;br /&gt;- Hypertext Transfer Protocol (HTTP)&lt;br /&gt;- SOAP &lt;br /&gt;&lt;br /&gt;3. SAML Components&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Assertions:&lt;/b&gt; Authentication, Attribute and Authorization information&lt;br /&gt;&lt;b&gt;Protocol:&lt;/b&gt; Request and Response elements for packaging assertions&lt;br /&gt;&lt;b&gt;Bindings:&lt;/b&gt; How SAML Protocols map onto standard messaging or communication protocols&lt;br /&gt;&lt;b&gt;Profiles:&lt;/b&gt; How SAML protocols, bindings and assertions combine to support a defined use case&lt;br /&gt;&lt;br /&gt;4. &lt;a href="http://docs.oasis-open.org/security/saml/v2.0/saml-core-2.0-os.pdf"&gt;Assertions and Protocols for SAML v2.0&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The Security Assertion Markup Language (SAML) defines the syntax and processing semantics of assertions made about a subject by a system entity. In the course of making, or relying upon such assertions, SAML system entities may use other protocols to communicate either regarding an assertion itself, or the subject of an assertion. This specification defines both the structure of SAML assertions, and&lt;br /&gt;an associated set of protocols, in addition to the processing rules involved in managing a SAML system. This specification is considered as the SAML Core specification and these constructs are typically embedded in other structures for transport, such as HTTP form POSTs and XML-encoded SOAP messages.&lt;br /&gt;&lt;br /&gt;5. &lt;a href="http://docs.oasis-open.org/security/saml/v2.0/saml-bindings-2.0-os.pdf"&gt;Bindings for SAML v2.0&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Bindings for SAML specifies SAML protocol bindings for the use of SAML assertions and request-response messages in communications protocols and frameworks.&lt;br /&gt;&lt;br /&gt;Mappings of SAML request-response message exchanges onto standard messaging or communication protocols are called SAML protocol bindings (or just bindings). An instance of mapping SAML requestresponse message exchanges into a specific communication protocol &amp;lt;FOO&amp;gt; is termed a &lt;foo&gt; binding for SAML or a SAML &amp;lt;FOO&amp;gt; binding.  For example, a SAML SOAP binding describes how SAML request and response message exchanges are mapped into SOAP message exchanges.&lt;br /&gt;&lt;br /&gt;The intent of this specification is to specify a selected set of bindings in sufficient detail to ensure that independently implemented SAML-conforming software can interoperate when using standard messaging or communication protocols.&lt;br /&gt;&lt;br /&gt;Following bindings are covered under this specification.&lt;br /&gt;&lt;br /&gt;- SAML SOAP Binding&lt;br /&gt;- Reverse SOAP (PAOS) Binding&lt;br /&gt;- HTTP Redirect Binding&lt;br /&gt;- HTTP POST Binding&lt;br /&gt;- HTTP Artifact Binding&lt;br /&gt;- SAML URI Binding&lt;br /&gt;&lt;br /&gt;6. &lt;a href="http://docs.oasis-open.org/security/saml/v2.0/saml-profiles-2.0-os.pdf"&gt;Profiles for SAML v2.0&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Profiles for SAML specifies profiles that define the use of SAML assertions and request-response messages in communications protocols and frameworks, as well as profiles that define SAML attribute value syntax and naming conventions.&lt;br /&gt;&lt;br /&gt;One type of SAML profile outlines a set of rules describing how to embed SAML assertions into and extract them from a framework or protocol. Such a profile describes how SAML assertions are embedded in or combined with other objects (for example, files of various types, or protocol data units of communication protocols) by an originating party, communicated from the originating party to a receiving party, and subsequently processed at the destination. A particular set of rules for embedding SAML assertions into and extracting them from a specific class of &amp;lt;FOO&amp;gt; objects is termed a &amp;lt;FOO&amp;gt; profile of SAML.&lt;br /&gt;&lt;br /&gt;For example, a SOAP profile of SAML describes how SAML assertions can be added to SOAP messages, how SOAP headers are affected by SAML assertions, and how SAML-related error states should be reflected in SOAP messages.&lt;br /&gt;&lt;br /&gt;Another type of SAML profile defines a set of constraints on the use of a general SAML protocol or assertion capability for a particular environment or context of use. Profiles of this nature may constrain optionality, require the use of specific SAML functionality (for example,  attributes, conditions, or bindings), and in other respects define the processing rules to be followed by profile actors.&lt;br /&gt;&lt;br /&gt;Following profiles are covered under this specification.&lt;br /&gt;&lt;br /&gt;- SSO Profiles of SAML [Web Browser SSO Profile,Enhanced Client or Proxy (ECP) Profile, Identity Provider Discovery Profile, Single Logout Profile, Name Identifier Management Profile]&lt;br /&gt;- Artifact Resolution Profile&lt;br /&gt;- Assertion Query/Request Profile&lt;br /&gt;- Name Identifier Mapping Profile&lt;br /&gt;- SAML Attribute Profiles&lt;br /&gt;&lt;br /&gt;7. &lt;a href="http://docs.oasis-open.org/security/saml/v2.0/saml-metadata-2.0-os.pdf"&gt;Metadata for SAML v2.0&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;SAML profiles require agreements between system entities regarding identifiers, binding support and endpoints, certificates and keys, and so forth. A metadata specification is useful for describing this information in a standardized way. This specification defines an extensible metadata format for SAML system entities, organized by roles that reflect SAML profiles. Such roles include that of SSO Identity Provider, SSO Service Provider, Affiliation, Attribute Authority, Attribute Requester, and Policy Decision Point.&lt;br /&gt;&lt;br /&gt;This specification further defines profiles for the dynamic exchange of metadata among system entities, which may be useful in some deployments.&lt;br /&gt;&lt;br /&gt;8. &lt;a href="http://docs.oasis-open.org/security/saml/v2.0/saml-conformance-2.0-os.pdf"&gt;Conformance Requirements for SAML v2.0&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This normative specification describes features that are mandatory and optional for implementations claiming conformance to SAML V2.0 and also specifies the entire set of documents comprising SAML V2.0.&lt;br /&gt;&lt;br /&gt;9. &lt;a href="http://docs.oasis-open.org/wss/v1.1/wss-v1.1-spec-os-SAMLTokenProfile.pdf"&gt;Web Services Security: SAML Token Profile 1.1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This specification describes how to use SAML V1.1 and V2.0 assertions with the Web Services Security SOAP Message Security V1.1 specification.&lt;br /&gt;&lt;br /&gt;10. &lt;a href="http://docs.oasis-open.org/xacml/access_control-xacml-2.0-saml_profile-spec-cd-02.pdf"&gt;SAML 2.0 profile of XACML&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The OASIS eXtensible Access Control Markup Language [XACML] is a powerful, standard&lt;br /&gt;language that specifies schemas for authorization policies and for authorization decision requests and responses.&lt;br /&gt;&lt;br /&gt;This profile defines how to use SAML 2.0 to protect, transport, and request XACML schema instances and other information needed by an XACML implementation.&lt;br /&gt;&lt;br /&gt;11. &lt;a href="http://docs.oasis-open.org/security/saml/v2.0/saml-sec-consider-2.0-os.pdf"&gt;Security and Privacy Considerations for SAML&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This non-normative document describes and analyzes the security and privacy properties of SAML defined in the core SAML specification and the SAML bindings and profiles specifications.&lt;br /&gt;&lt;br /&gt;12. &lt;a href="http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml-attribute-kerberos-cs01.pdf"&gt;SAML V2.0 Kerberos Attribute Profile&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This specification defines an attribute profile for the Kerberos protocol. The SAML V2.0 Kerberos Attribute Profile describes a SAML attribute profile for requesting and expressing Kerberos protocol messages. In this version of the specification, this is constrained to the Kerberos KRB-CRED message type. The mechanisms that are used to generate the Kerberos message are outside the scope of this document and are described by IETF RFC 4120: 'The Kerberos Network Authentication Service (V5)'.&lt;br /&gt;&lt;br /&gt;13. &lt;a href="http://docs.oasis-open.org/security/saml/Post2.0/sstc-saml2-notify-protocol/v1.0/sstc-saml2-notify-protocol-v1.0.pdf"&gt;SAML V2.0 Change Notify Protocol&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The SAML V2.0 Change Notify Protocol describes request and response messages for informing SAML endpoints about available changes to subjects and attributes associated with subjects.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-4533708715547946229?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/4533708715547946229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=4533708715547946229' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4533708715547946229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4533708715547946229'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/11/depth-of-saml-saml-summary.html' title='The depth of SAML [SAML Summary]'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-5615899318887841469</id><published>2011-11-24T15:50:00.003+05:30</published><updated>2011-11-24T16:01:59.775+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SAML'/><category scheme='http://www.blogger.com/atom/ns#' term='WS-Security'/><title type='text'>SAML Assertions and XML Signature</title><content type='html'>SAML assertions and SAML protocol request and response messages may be signed, with the following benefits:&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. An assertion signed by the SAML authority supports:&lt;/b&gt;&lt;br /&gt;– Assertion integrity.&lt;br /&gt;– Authentication of the SAML authority to a SAML relying party.&lt;br /&gt;– If the signature is based on the SAML authority’s public-private key pair, then it also provides for non-repudiation of origin.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. A SAML protocol request or response message signed by the message originator supports:&lt;/b&gt;&lt;br /&gt;– Message integrity.&lt;br /&gt;– Authentication of message origin to a destination.&lt;br /&gt;– If the signature is based on the originator's public-private key pair, then it also provides for non-repudiation of origin.&lt;br /&gt;&lt;br /&gt;The [1] talks about only signing the Assertion - and [2] talks about signing the request as well as the response message which also carries the Assertion.&lt;br /&gt;&lt;br /&gt;A digital signature is not always required in SAML. For example, it may not be required in the following situations:&lt;br /&gt;&lt;br /&gt;- In some circumstances signatures may be “inherited," such as when an unsigned assertion gains protection from a signature on the containing protocol response message. "Inherited" signatures should be used with care when the contained object (such as the assertion) is intended to have non-transitory lifetime. The reason is that the entire context must be retained to allow validation, exposing the XML content and adding potentially unnecessary overhead.&lt;br /&gt;&lt;br /&gt;- The SAML relying party or SAML requester may have obtained an assertion or protocol message from the SAML authority or SAML responder directly (with no intermediaries) through a secured channel, with the SAML authority or SAML responder having authenticated to the relying party or SAML responder by some means other than a digital signature.&lt;br /&gt;&lt;br /&gt;It is recommended that, in all other contexts, digital signatures be used for assertions and request and response messages. Specifically:&lt;br /&gt;&lt;br /&gt;- A SAML assertion obtained by a SAML relying party from an entity other than the SAML authority SHOULD be signed by the SAML authority.&lt;br /&gt;- A SAML protocol message arriving at a destination from an entity other than the originating site SHOULD be signed by the origin site.&lt;br /&gt;&lt;br /&gt;XML Signatures are intended to be the primary SAML signature mechanism.&lt;br /&gt;&lt;br /&gt;Unless a profile specifies an alternative signature mechanism, enveloped XML Digital Signatures MUST be used if signing. This is bit different from the signature pattern recommended in WS-Security specification.&lt;br /&gt;&lt;br /&gt;WS-Security specification says..&lt;br /&gt;&lt;br /&gt;"Because of the mutability of some SOAP headers, producers SHOULD NOT use the Enveloped Signature Transform defined in XML Signature. Instead, messages SHOULD explicitly include the elements to be signed.  Similarly, producers SHOULD NOT use the Enveloping Signature defined in XML Signature".&lt;br /&gt;&lt;br /&gt;Although this contrasts with what is recommended in SAML specification - WS-Security doesn't have nothing to with SAML. SAML becomes a token type for WS-Security and SAML specification has the full control to define it's own recommendation for signing.&lt;br /&gt;&lt;br /&gt;Why SAML specification recommends enveloped signature?&lt;br /&gt;&lt;br /&gt;With enveloped signature, the signature element will be inside the element been signed it self - which is the Assertion element.&lt;br /&gt;&lt;br /&gt;Enveloped signature is useful when we have a signed XML document that we wish to insert into other XML documents. Which is the case with SAML Assertion. There you get the SAML Assertion from the issuer and include it in to a request to the service provider.&lt;br /&gt;&lt;br /&gt;SAML implementations also SHOULD use Exclusive Canonicalization [Excl-C14N], with or without comments, both in the &lt;ds:CanonicalizationMethod&gt; element of &lt;ds:SignedInfo&gt;, and as a &lt;ds:Transform&gt; algorithm. Use of Exclusive Canonicalization ensures that signatures created over SAML messages embedded in an XML context can be verified independent of that context.&lt;br /&gt;&lt;br /&gt;Exclusive Canonicalization tries to figure out what namespaces you are actually using and just copies those. Specifically, it copies the ones that are "visibly used", which means the ones that are a part of the XML syntax. However, it does not look into attribute values or element content, so the namespace declarations required to process these are not copied. For example if you had an attribute like xx:foo="yy:bar" it would copy the declaration for xx, but not yy. It also does not copy the xml: attributes that are declared outside the scope of the signature.&lt;br /&gt;&lt;br /&gt;Exclusive Canonicalization allows you to create a list of the namespaces that must be declared, so that it will pick up the declarations for the ones that are not visibly used. &lt;br /&gt;&lt;br /&gt;Exclusive Canonicalization is useful when you have a signed XML document that you wish to insert into other XML documents - as in a signed SAML assertion which might be inserted as a XML Token in the security header of various SOAP messages. The Issuer who signs the assertion will be aware of the namespaces being used and able to construct the list. The use of Exclusive Canonicalization will insure the signature verifies correctly every time.&lt;br /&gt;&lt;br /&gt;In contrast, the Inclusive Canonicalization copies all the declarations that are currently in force, even if they are defined outside of the scope of the signature. It also copies any xml: attributes that are in force, such as xml:lang or xml:base. This guarantees that all the declarations you might make use of will be unambigiously specified. The problem with this is that if the signed XML is moved into another XML document which has other declarations, the Inclusive Canonicalization will copy them and the signature will be invalid. This can even happen if you simply add an attribute in a different namespace to the surrounding context.&lt;br /&gt;&lt;br /&gt;References :&lt;br /&gt;1. &lt;a href="http://www.oasis-open.org/committees/download.php/3406/oasis-sstc-saml-core-1.1.pdf"&gt;http://www.oasis-open.org/committees/download.php/3406/oasis-sstc-saml-core-1.1.pdf&lt;/a&gt;&lt;br /&gt;2. &lt;a href="http://lists.oasis-open.org/archives/wss/200311/msg00058.html"&gt;http://lists.oasis-open.org/archives/wss/200311/msg00058.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-5615899318887841469?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/5615899318887841469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=5615899318887841469' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5615899318887841469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5615899318887841469'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/11/saml-assertions-and-xml-signature.html' title='SAML Assertions and XML Signature'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-4580462805635663268</id><published>2011-11-21T17:25:00.001+05:30</published><updated>2011-11-21T22:15:20.753+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Secure Conversation'/><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='WS-Trust'/><title type='text'>Key Exchange Patterns with Web Services Security</title><content type='html'>When we have message level security with web services - how we achieve integrity and confidentiality is through keys. Keys are used to sign and encrypt messages been passed from the rqeuestor to the recipient or form the client to the service and vise versa.&lt;br /&gt;&lt;br /&gt;During this blog post, we'll be discussing different key exchange patterns and their related use cases.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. Direct Key Transfer&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;If one party has a token and key and wishes to share this with another party, the key can be directly transferred. WS-Secure Conversation is a good example for this. Under WS-Secure Conversation, when the security context token is created by one of the communicating parties and propagated with a message it occupies this pattern to do the key exchange. This is accomplished by the initiator sending an RSTR (either in the body or header) to the other party. The RSTR contains the token and a proof-of-possession token that contains the key encrypted for the recipient.&lt;br /&gt;&lt;br /&gt;The initiator creates a security context token and sends it to the other parties on a message using the mechanisms described in WS-Trust specification. This model works when the sender is trusted to always create a new security context token.  For this scenario the initiating party creates a security context token and issues a signed unsolicited &amp;lt;wst:RequestSecurityTokenResponse&gt; to the other party.  The message contains a &amp;lt;wst:RequestedSecurityToken&gt; containing (or pointing to) the new security context token and a &amp;lt;wst:RequestedProofToken&gt; pointing to the "secret" for the security context token. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;2. Brokered Key Distribution&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;A third party MAY also act as a broker to transfer keys.  For example, a requestor may obtain a token and proof-of-possession token from a third-party STS.  The token contains a key encrypted for the target service (either using the service's public key or a key known to the STS and target service).  The proof-of-possession token contains the same key encrypted for the requestor (similarly this can use public or symmetric keys).&lt;br /&gt;&lt;br /&gt;WS-Secure Conversation also has an example for this pattern when the security context token is created by a security token service – The context initiator asks a security token service to create a new security context token. The newly created security context token is distributed to the parties through the mechanisms defined here and in WS-Trust. For this scenario the initiating party sends &amp;lt;wst:RequestSecurityToken&gt; request to the token service and a &amp;lt;wst:RequestSecurityTokenResponseCollection&gt; containing a &amp;lt;wst:RequestSecurityTokenResponse&gt; is returned.  The response contains a &amp;lt;wst:RequestedSecurityToken&gt; containing (or pointing to) the new security context token and a &amp;lt;wst:RequestedProofToken&gt; pointing to the "secret" for the returned context. The requestor then uses the security context token when securing messages to applicable services.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;3. Delegated Key Transfer&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Key transfer can also take the form of delegation. That is, one party transfers the right to use a key without actually transferring the key.  In such cases, a delegation token, e.g. &lt;a href="http://www.xrml.org/faq.asp"&gt;XrML&lt;/a&gt;, is created that identifies a set of rights and a delegation target and is secured by the delegating party.  That is, one key indicates that another key can use a subset (or all) of its rights.  The delegate can provide this token and prove itself (using its own key – the delegation target) to a service.  The service, assuming the trust relationships have been established and that the delegator has the right to delegate, can then authorize requests sent subject to delegation rules and trust policies.&lt;br /&gt;&lt;br /&gt;For example a custom token is issued from party A to party B.  The token indicates that B (specifically B's key) has the right to submit purchase orders.  The token is signed using a secret key known to the target service T and party A (the key used to ultimately authorize the requests that B makes to T), and a new session key that is encrypted for T.  A proof-of-possession token is included that contains the session key encrypted for B.  As a result, B is effectively using A's key, but doesn't actually know the key.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;4. Authenticated Request/Reply Key Transfer&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In some cases the RST/RSTR mechanism is not used to transfer keys because it is part of a simple request/reply.  However, there may be a desire to ensure mutual authentication as part of the key transfer. The mechanisms of WS-Security can be used to implement this scenario.&lt;br /&gt;&lt;br /&gt;Specifically, the sender wishes the following:&lt;br /&gt;- Transfer a key to a recipient that they can use to secure a reply&lt;br /&gt;- Ensure that only the recipient can see the key&lt;br /&gt;- Provide proof that the sender issued the key&lt;br /&gt;&lt;br /&gt;This scenario could be supported by encrypting and then signing.  This would result in roughly the following steps:&lt;br /&gt;&lt;br /&gt;1. Encrypt the message using a generated key&lt;br /&gt;2. Encrypt the key for the recipient&lt;br /&gt;3. Sign the encrypted form, any other relevant keys, and the encrypted key&lt;br /&gt;&lt;br /&gt;However, if there is a desire to sign prior to encryption then the following general process is used:&lt;br /&gt;&lt;br /&gt;1. Sign the appropriate message parts using a random key (or ideally a key derived from a random key)&lt;br /&gt;2. Encrypt the appropriate message parts using the random key (or ideally another key derived from the random key)&lt;br /&gt;3. Encrypt the random key for the recipient&lt;br /&gt;4. Sign just the encrypted key&lt;br /&gt;&lt;br /&gt;Most part of this blog post is extracted from &lt;a href="http://docs.oasis-open.org/ws-sx/ws-trust/v1.4/ws-trust.pdf"&gt;WS-Trust 1.4&lt;/a&gt; specification.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-4580462805635663268?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/4580462805635663268/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=4580462805635663268' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4580462805635663268'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4580462805635663268'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/11/key-exchange-patterns-with-web-services.html' title='Key Exchange Patterns with Web Services Security'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total><georss:featurename>Colombo, Sri Lanka</georss:featurename><georss:point>6.9270786 79.86124300000006</georss:point><georss:box>6.8676306 79.83564050000005 6.9865265999999995 79.88684550000006</georss:box></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-6095039732116068861</id><published>2011-11-20T16:20:00.008+05:30</published><updated>2011-11-20T17:28:37.144+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='WS-Trust'/><title type='text'>Understanding Entropy</title><content type='html'>This blog post is inspired by a question asked from one of my team mates - so.. here I am trying to explain what is entropy and it's role in web services security.&lt;br /&gt;&lt;br /&gt;In information theory, entropy is a measure of the uncertainty associated with a random variable. In other words, entropy adds randomness to a generated key.&lt;br /&gt;&lt;br /&gt;In WS-Trust, under Holder-of-Key scenario - the Security Token Service has to generate a key and pass that to the client - which will later be used between the client and the service to secure the communication.&lt;br /&gt;&lt;br /&gt;Let's see how this is done.. Let's have a look at some part of the client request to the Security Token Service.&lt;pre class="html" name="code"&gt;&amp;lt;wst:Entropy&amp;gt;&lt;br /&gt;    &amp;lt;wst:BinarySecret&lt;br /&gt;     Type=&amp;quot;http://schemas.xmlsoap.org/ws/2005/02/trust/Nonce&amp;quot;&amp;gt;nVY8/so9I3uvI3OSXDcyb+9kxWxMFNiwzT7qcsr5Hpw=&lt;br /&gt;    &amp;lt;/wst:BinarySecret&amp;gt;&lt;br /&gt;   &amp;lt;/wst:Entropy&amp;gt;&lt;br /&gt;   &amp;lt;wst:ComputedKeyAlgorithm&amp;gt;http://schemas.xmlsoap.org/ws/2005/02/trust/CK/PSHA1&amp;lt;/wst:ComputedKeyAlgorithm&amp;gt;&lt;br /&gt;&lt;/pre&gt;Here you can see, the Entropy element is included in the request.&lt;br /&gt;&lt;br /&gt;This optional element allows a requestor to specify entropy that is to be used in creating the key. The value of this element should be either a &amp;lt;xenc:EncryptedKey&gt; or &amp;lt;wst:BinarySecret&gt; depending on whether or not the key is encrypted. Secrets should be encrypted unless the transport/channel is already providing encryption. The BinarySecret element specifies a base64 encoded sequence of octets representing the requestor's entropy.&lt;br /&gt;&lt;br /&gt;The keys resulting from a request are determined in one of three ways...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;1. Specific&lt;/b&gt;&lt;br /&gt;&lt;b&gt;2. Partial&lt;/b&gt;&lt;br /&gt;&lt;b&gt;3. Omitted&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;In the case of specific keys, a &amp;lt;wst:RequestedProofToken&gt; element is included in the response which indicates the specific key(s) to use unless the key was provided by the requestor(in which case there is no need to return it). This happens if the requestor does not provide entropy or issuer rejects the requestor's entropy.&lt;br /&gt;&lt;br /&gt;In the case of partial, the &amp;lt;wst:Entropy&gt; element is included in the response, which indicates partial key material from the issuer (not the full key) that is combined (by each party) with the requestor's entropy to determine the resulting key(s).  In this case a &amp;lt;wst:ComputedKey&gt; element is returned inside the &amp;lt;wst:RequestedProofToken&gt; to indicate how the key is computed. This happens if the requestor provides entropy and the issuer honors it. Here you will see, in the response it will have an Entropy element - which includes the issuer's entropy.&lt;pre class="html" name="code"&gt;&amp;lt;wst:RequestedProofToken&amp;gt;&lt;br /&gt;    &amp;lt;wst:ComputedKey&amp;gt;http://schemas.xmlsoap.org/ws/2005/02/trust/CK/PSHA1&lt;br /&gt;    &amp;lt;/wst:ComputedKey&amp;gt;&lt;br /&gt;   &amp;lt;/wst:RequestedProofToken&amp;gt;&lt;br /&gt;   &amp;lt;wst:Entropy&amp;gt;&lt;br /&gt;    &amp;lt;wst:BinarySecret&lt;br /&gt;     Type=&amp;quot;http://schemas.xmlsoap.org/ws/2005/02/trust/Nonce&amp;quot;&amp;gt;3nBXagllniQA8UEAs5uRVJFrKb9dPZITK76Xk/XCO5o=&lt;br /&gt;    &amp;lt;/wst:BinarySecret&amp;gt;&lt;br /&gt;   &amp;lt;/wst:Entropy&amp;gt;&lt;br /&gt;&lt;/pre&gt;In the case of omitted, an existing key is used or the resulting token is not directly associated with a key. This happens if the requestor provides entropy and the responder doesn't (issuer uses the requestor's key), then a proof-of-possession token need not be returned.&lt;br /&gt;&lt;br /&gt;Following table summarizes the use of Entropy.&lt;br /&gt;&lt;br /&gt;&lt;table border="1"&gt;&lt;tr&gt; &lt;th&gt;Requestor&lt;/th&gt; &lt;th&gt;Issuer&lt;/th&gt; &lt;th&gt;Result&lt;/th&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;Provides Entropy&lt;/td&gt; &lt;td&gt;Uses requestor entropy as key&lt;/td&gt; &lt;td&gt;No proof-of-possession token is returned&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;Provides Entropy&lt;/td&gt; &lt;td&gt;Provides entropy&lt;/td&gt; &lt;td&gt;No keys returned, key(s) derived using entropy from both sides according to method identified in response. Issuer's Entropy is returned to the client and the way the key was derived specified under ComputedKey element.&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;Provides Entropy&lt;/td&gt; &lt;td&gt;Issues own key (rejects requestor's entropy)&lt;/td&gt; &lt;td&gt;Proof-of-possession token contains issuer's key(s)&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;No Entropy provided&lt;/td&gt; &lt;td&gt;Issues own key&lt;/td&gt; &lt;td&gt;Proof-of-possession token contains issuer's key(s)&lt;/td&gt; &lt;/tr&gt;&lt;tr&gt; &lt;td&gt;No Entropy provided&lt;/td&gt; &lt;td&gt;Does not issue key&lt;/td&gt; &lt;td&gt;No proof-of-possession token&lt;/td&gt; &lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-6095039732116068861?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/6095039732116068861/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=6095039732116068861' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6095039732116068861'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6095039732116068861'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/11/understanding-entropy.html' title='Understanding Entropy'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-4288384332282715672</id><published>2011-11-15T19:04:00.008+05:30</published><updated>2011-11-16T01:08:12.596+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SAML'/><category scheme='http://www.blogger.com/atom/ns#' term='Rampart'/><category scheme='http://www.blogger.com/atom/ns#' term='WS-Trust'/><category scheme='http://www.blogger.com/atom/ns#' term='WS-Security'/><title type='text'>Subject Confirmation support with Apache Rampart : Holder-of-Key</title><content type='html'>The Subject Confirmation is the process of establishing the correspondence between the subject and claims of SAML statements (in SAML assertions) and SOAP message content by verifying the confirmation evidence provided by an attesting entity.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.oasis-open.org/committees/download.php/16768/wss-v1.1-spec-os-SAMLTokenProfile.pdf"&gt;SAML 1.1 Token Profile&lt;/a&gt; talks about three subject confirmation methods.&lt;br /&gt;&lt;br /&gt;1. &lt;b&gt;Holder-of-key Subject Confirmation Method&lt;/b&gt;&lt;br /&gt;2. &lt;b&gt;Bearer-key Subject Confirmation Method&lt;/b&gt;&lt;br /&gt;2. &lt;b&gt;Sender-vouches Subject Confirmation Method&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;With Holder-of-key Subject Confirmation Method, the attesting entity demonstrates that it is authorized to act as the subject of a holder-of-key confirmed SAML statement by demonstrating knowledge of any key identified in a holder-of-key SubjectConfirmation element associated with the statement by the assertion containing the statement. Statements attested for by the holder-of-key method MUST be associated, within their containing assertion, with one or more holder-of-key SubjectConfirmation elements.&lt;br /&gt;&lt;br /&gt;Let's see how this works..&lt;br /&gt;&lt;br /&gt;First the client application needs to request a token from the Security Token Service or the STS. This request is known as RST [wst:RequestSecurityToken] and goes inside the SOAP Body. Following is a sample RST.&lt;pre class="html" name="code"&gt;&lt;wst:RequestSecurityToken&lt;br /&gt;   xmlns:wst="http://schemas.xmlsoap.org/ws/2005/02/trust"&gt;&lt;br /&gt;   &lt;wst:RequestType&gt;http://schemas.xmlsoap.org/ws/2005/02/trust/Issue&lt;br /&gt;   &lt;/wst:RequestType&gt;&lt;br /&gt;   &lt;wsp:AppliesTo xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"&gt;&lt;br /&gt;    &lt;wsa:EndpointReference&lt;br /&gt;     xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"&gt;&lt;br /&gt;     &lt;wsa:Address&gt;http://localhost:8280/services/echo&lt;/wsa:Address&gt;&lt;br /&gt;    &lt;/wsa:EndpointReference&gt;&lt;br /&gt;   &lt;/wsp:AppliesTo&gt;&lt;br /&gt;   &lt;wst:Lifetime&gt;&lt;br /&gt;    &lt;wsu:Created&lt;br /&gt;     xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt;2011-11-15T10:29:17.487Z&lt;/wsu:Created&gt;&lt;br /&gt;    &lt;wsu:Expires&lt;br /&gt;     xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt;2011-11-15T10:34:17.487Z&lt;/wsu:Expires&gt;&lt;br /&gt;   &lt;/wst:Lifetime&gt;&lt;br /&gt;   &lt;wst:TokenType&gt;http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1&lt;br /&gt;   &lt;/wst:TokenType&gt;&lt;br /&gt;   &lt;wst:KeyType&gt;http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey&lt;br /&gt;   &lt;/wst:KeyType&gt;&lt;br /&gt;   &lt;wst:KeySize&gt;256&lt;/wst:KeySize&gt;&lt;br /&gt;   &lt;wst:Entropy&gt;&lt;br /&gt;    &lt;wst:BinarySecret&lt;br /&gt;     Type="http://schemas.xmlsoap.org/ws/2005/02/trust/Nonce"&gt;nVY8/so9I3uvI3OSXDcyb+9kxWxMFNiwzT7qcsr5Hpw=&lt;br /&gt;    &lt;/wst:BinarySecret&gt;&lt;br /&gt;   &lt;/wst:Entropy&gt;&lt;br /&gt;   &lt;wst:ComputedKeyAlgorithm&gt;http://schemas.xmlsoap.org/ws/2005/02/trust/CK/PSHA1&lt;br /&gt;   &lt;/wst:ComputedKeyAlgorithm&gt;&lt;br /&gt;  &lt;/wst:RequestSecurityToken&gt;&lt;br /&gt;&lt;/pre&gt;Let's have a look at some of the key elements in the RST.&lt;br /&gt;&lt;br /&gt;1. &lt;b&gt;AppliesTo&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;This is the end point where the client going to use this token against.&lt;br /&gt;&lt;br /&gt;2. &lt;b&gt;KeyType : http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Use Symmetric key when generating the key for the SubjectConfirmation.&lt;br /&gt;&lt;br /&gt;3. &lt;b&gt;KeySize&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Use this key size when generating the key for the SubjectConfirmation.&lt;br /&gt;&lt;br /&gt;4. &lt;b&gt;Entropy/BinarySecret&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;WS-Trust allows the requestor to provide input to the key material via a wst:Entropy element in the request. The requestor might do this to satisfy itself as to the degree of entropy (cryptographic randomness if you will) of at least some of the material used to generate the actual key which is used for SubjectConfirmation.&lt;br /&gt;&lt;br /&gt;5. &lt;b&gt;Entropy/ComputedKeyAlgorithm : http://schemas.xmlsoap.org/ws/2005/02/trust/CK/PSHA1 &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The key derivation algorithm to use if using a symmetric key for P, where P is computed using client, server, or combined entropy.&lt;br /&gt;&lt;br /&gt;With &lt;b&gt;http://schemas.xmlsoap.org/ws/2005/02/trust/CK/PSHA1&lt;/b&gt; the key is computed using P_SHA1 from the TLS specification to generate a bit stream using entropy from both sides. The exact form is:&lt;br /&gt;&lt;b&gt;key = P_SHA1 (EntREQ, EntRES)&lt;/b&gt;&lt;br /&gt;It is RECOMMENDED that EntREQ be a string of length at least 128 bits.&lt;br /&gt;&lt;br /&gt;Now let's see how this request been processed at the STS end.&lt;br /&gt;&lt;br /&gt;Based on the Key Type in the request - STS will decide whether to use Holder-of-key or not. For following key types, holder-of-key subject confirmation method will be used.&lt;br /&gt;&lt;br /&gt;1. http://docs.oasis-open.org/ws-sx/ws- trust/200512/PublicKey&lt;br /&gt;2. http://docs.oasis-open.org/ws-sx/ws- trust/200512/SymmetricKey&lt;br /&gt;&lt;br /&gt;If it is SymmetricKey - then STS will generate a key - encrypt the key using the public certificate corresponding to the end point attached to the AppliesTo element in the RST and add that to the SubjectConfirmation element in the response.&lt;br /&gt;&lt;br /&gt;Key generation is once again bit tricky.&lt;br /&gt;&lt;br /&gt;If client provides an entropy and the key computation algorithm is http://schemas.xmlsoap.org/ws/2005/02/trust/CK/PSHA1 then, the key is generated as a function of the client entropy and the STS entropy.&lt;br /&gt;&lt;br /&gt;If client provides an entropy but the key computation algorithm is NOT http://schemas.xmlsoap.org/ws/2005/02/trust/CK/PSHA1 then, the key is same as the client entropy.&lt;br /&gt;&lt;br /&gt;If neither of above happens, then the server generates an ephemeral key.&lt;br /&gt;&lt;br /&gt;Whatever the way the key is generated, it will be encrypted with the certificate corresponding to the AppliesTo end point and will be added in to the SubjectConfirmation element in the response.&lt;pre class="html" name="code"&gt;&lt;subjectconfirmation&gt;&lt;br /&gt;        &lt;confirmationmethod&gt;urn:oasis:names:tc:SAML:1.0:cm:holder-of-key&lt;br /&gt;        &lt;/ConfirmationMethod&gt;&lt;br /&gt;        &lt;keyinfo xmlns="http://www.w3.org/2000/09/xmldsig#"&gt;&lt;br /&gt;         &lt;xenc:EncryptedKey xmlns:ds="http://www.w3.org/2000/09/xmldsig#"&lt;br /&gt;          Id="EncKeyId-3C611397F54EB4BEF913213415708916"&gt;&lt;br /&gt;          &lt;xenc:EncryptionMethod&lt;br /&gt;           Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" /&gt;&lt;br /&gt;          &lt;ds:KeyInfo&gt;&lt;br /&gt;           &lt;wsse:SecurityTokenReference&lt;br /&gt;            xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;&lt;br /&gt;            &lt;wsse:KeyIdentifier&lt;br /&gt;             EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"&lt;br /&gt;             ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1"&gt;Ye9D13/K1GFRvJjgw1kSr5/rYxE=&lt;/wsse:KeyIdentifier&gt;&lt;br /&gt;           &lt;/wsse:SecurityTokenReference&gt;&lt;br /&gt;          &lt;/ds:KeyInfo&gt;&lt;br /&gt;          &lt;xenc:CipherData&gt;&lt;br /&gt;           &lt;xenc:CipherValue&gt;a/kALeV0b0Y3oNcE7fdepUuF0sbQUGs012r87BMBUx/FL8Hc+kw/BGrRThEGGmDmVgJ8GdJw34nQM6IjulNV+hj/MmtXLSKZnjm7uLPPT3kgT0udzc8OuSgLVRO8ghcDK12/IiPAtzWZIfPS/ZT8kx4DSYWnvcNa4mTMM4wBhjt29bvAJcKZD0CqvJOLIFWc2FrQqNkym4UIF+GEcsN3rQcYDzoyiCm2L4RAm3u+1d+9zsQIEo8DtqDDboA0MAVbbM6xU3JbF35dLifmpwlsuiJC0y8VlAoN6wnNIJ/tpr4C4FhvdKnShAOeDf3D2JkZxr4ZNZZL91aHFaPpFbC9YQ==&lt;br /&gt;           &lt;/xenc:CipherValue&gt;&lt;br /&gt;          &lt;/xenc:CipherData&gt;&lt;br /&gt;         &lt;/xenc:EncryptedKey&gt;&lt;br /&gt;        &lt;/KeyInfo&gt;&lt;br /&gt;       &lt;/SubjectConfirmation&gt;&lt;br /&gt;&lt;/pre&gt;As per the above code, what you see inside CipherValue element is the encrypted key. And it is encrypted from a certificate which is having the thumbprint reference &lt;b&gt;Ye9D13/K1GFRvJjgw1kSr5/rYxE=&lt;/b&gt;. In other words, only the service which owns the certificate having the thumbprint reference &lt;b&gt;Ye9D13/K1GFRvJjgw1kSr5/rYxE=&lt;/b&gt; would be able to decrypt the key - which is in fact the service end point attached to the AppliesTo element. BTW... can anybody in the middle fool the service endpoint just by replacing the SubjectConfirmation element..? This is prevented by STS signing the SubjectConfirmation element along with Assertion parent element with it's private key. So - the SAML token is protected for integrity.&lt;br /&gt;&lt;br /&gt;Okay... now the token is at the client end... In which ways the client application going to use this token.&lt;br /&gt;&lt;br /&gt;One way is to use it as a SupportingToken and the other way is to use it as a ProtectionToken.&lt;br /&gt;&lt;br /&gt;When we use SAML token as a ProtectionToken, client application can use it to encrypt/sign the messages going from the client to the service end point. Then the question is which key would the client use to sign and encrypt - it's the same key added to the SubjectConfirmation by the STS - but it's encrypted with the public key of the service end point - so, client won't be able to decrypt it and get access to the hidden key.&lt;br /&gt;&lt;br /&gt;There is another way, STS passes the generated key to the client. Let's look at the following element also included in the response passed from the STS to the client - this is out side the Assertion element.&lt;pre class="html" name="code"&gt;&amp;lt;wst:Entropy&amp;gt;&lt;br /&gt;    &amp;lt;wst:BinarySecret&lt;br /&gt;     Type=&amp;quot;http://schemas.xmlsoap.org/ws/2005/02/trust/Nonce&amp;quot;&amp;gt;3nBXagllniQA8UEAs5uRVJFrKb9dPZITK76Xk/XCO5o=&lt;br /&gt;    &amp;lt;/wst:BinarySecret&amp;gt;&lt;br /&gt;   &amp;lt;/wst:Entropy&amp;gt;&lt;br /&gt;&lt;/pre&gt;Here in the Entropy/BinarySecret STS passed the entropy created to generate the key. The key is generated as a function of the client entropy and the STS entropy - client already knows the client entropy and can find the STS entropy inside Entropy/BinarySecret in the response - so, client can derive the key from those.&lt;br /&gt;&lt;br /&gt;Following would be the WS-Security Policy at the service end, which expects SAML token as a ProtectionToken.&lt;pre class="html" name="code"&gt;&amp;lt;wsp:Policy wsu:Id=&amp;quot;SgnOnlyAnonymous&amp;quot;&lt;br /&gt; xmlns:wsu=&amp;quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&amp;quot;&lt;br /&gt; xmlns:wsp=&amp;quot;http://schemas.xmlsoap.org/ws/2004/09/policy&amp;quot; xmlns:wsa=&amp;quot;http://schemas.xmlsoap.org/ws/2004/08/addressing&amp;quot;&lt;br /&gt; xmlns:sp=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;wsp:ExactlyOne&amp;gt;&lt;br /&gt;  &amp;lt;wsp:All&amp;gt;&lt;br /&gt;   &amp;lt;sp:SymmetricBinding&amp;gt;&lt;br /&gt;    &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;     &amp;lt;sp:ProtectionToken&amp;gt;&lt;br /&gt;      &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;       &amp;lt;sp:IssuedToken&lt;br /&gt;        sp:IncludeToken=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;Issuer xmlns=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy&amp;quot;&amp;gt;&lt;br /&gt;         &amp;lt;Address xmlns=&amp;quot;http://www.w3.org/2005/08/addressing&amp;quot;&amp;gt;http://localhost:8080/axis2/services/STS&lt;br /&gt;         &amp;lt;/Address&amp;gt;&lt;br /&gt;        &amp;lt;/Issuer&amp;gt;&lt;br /&gt;        &amp;lt;sp:RequestSecurityTokenTemplate&amp;gt;&lt;br /&gt;         &amp;lt;t:TokenType xmlns:t=&amp;quot;http://schemas.xmlsoap.org/ws/2005/02/trust&amp;quot;&amp;gt;http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1&lt;br /&gt;         &amp;lt;/t:TokenType&amp;gt;&lt;br /&gt;         &amp;lt;t:KeyType xmlns:t=&amp;quot;http://schemas.xmlsoap.org/ws/2005/02/trust&amp;quot;&amp;gt;http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey&lt;br /&gt;         &amp;lt;/t:KeyType&amp;gt;&lt;br /&gt;         &amp;lt;t:KeySize xmlns:t=&amp;quot;http://schemas.xmlsoap.org/ws/2005/02/trust&amp;quot;&amp;gt;256&amp;lt;/t:KeySize&amp;gt;&lt;br /&gt;        &amp;lt;/sp:RequestSecurityTokenTemplate&amp;gt;&lt;br /&gt;        &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;         &amp;lt;sp:RequireInternalReference /&amp;gt;&lt;br /&gt;        &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;       &amp;lt;/sp:IssuedToken&amp;gt;&lt;br /&gt;      &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;     &amp;lt;/sp:ProtectionToken&amp;gt;&lt;br /&gt;     &amp;lt;sp:AlgorithmSuite&amp;gt;&lt;br /&gt;      &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;       &amp;lt;sp:Basic128 /&amp;gt;&lt;br /&gt;      &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;     &amp;lt;/sp:AlgorithmSuite&amp;gt;&lt;br /&gt;     &amp;lt;sp:Layout&amp;gt;&lt;br /&gt;      &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;       &amp;lt;sp:Lax /&amp;gt;&lt;br /&gt;      &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;     &amp;lt;/sp:Layout&amp;gt;&lt;br /&gt;     &amp;lt;sp:IncludeTimestamp /&amp;gt;&lt;br /&gt;     &amp;lt;sp:OnlySignEntireHeadersAndBody /&amp;gt;&lt;br /&gt;    &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;   &amp;lt;/sp:SymmetricBinding&amp;gt;&lt;br /&gt;   &amp;lt;sp:SignedParts&amp;gt;&lt;br /&gt;    &amp;lt;sp:Header Name=&amp;quot;To&amp;quot; Namespace=&amp;quot;http://www.w3.org/2005/08/addressing&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;sp:Body /&amp;gt;&lt;br /&gt;   &amp;lt;/sp:SignedParts&amp;gt;&lt;br /&gt;   &amp;lt;sp:Wss11&amp;gt;&lt;br /&gt;    &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;     &amp;lt;sp:MustSupportRefKeyIdentifier /&amp;gt;&lt;br /&gt;     &amp;lt;sp:MustSupportRefIssuerSerial /&amp;gt;&lt;br /&gt;     &amp;lt;sp:MustSupportRefThumbprint /&amp;gt;&lt;br /&gt;     &amp;lt;sp:MustSupportRefEncryptedKey /&amp;gt;&lt;br /&gt;     &amp;lt;sp:RequireSignatureConfirmation /&amp;gt;&lt;br /&gt;    &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;   &amp;lt;/sp:Wss11&amp;gt;&lt;br /&gt;   &amp;lt;sp:Trust10&amp;gt;&lt;br /&gt;    &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;     &amp;lt;sp:MustSupportIssuedTokens /&amp;gt;&lt;br /&gt;     &amp;lt;sp:RequireClientEntropy /&amp;gt;&lt;br /&gt;     &amp;lt;sp:RequireServerEntropy /&amp;gt;&lt;br /&gt;    &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;   &amp;lt;/sp:Trust10&amp;gt;&lt;br /&gt;  &amp;lt;/wsp:All&amp;gt;&lt;br /&gt; &amp;lt;/wsp:ExactlyOne&amp;gt;&lt;br /&gt;&amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;&lt;/pre&gt;When we use the SAML token as a SupportingToken, we basically doing nothing from it that sending it as it is to the service end in the SOAP Security Header. SubjectConfirmation goes useless here - but service end can verify whether the token been issued by a trusted STS, by verifying the signature.&lt;br /&gt;&lt;br /&gt;Following is the WS-Security Policy at the service end - which expects SAML token as a SupportingToken. &lt;pre class="html" name="code"&gt;&amp;lt;wsp:Policy xmlns:wsp=&amp;quot;http://schemas.xmlsoap.org/ws/2004/09/policy&amp;quot;&lt;br /&gt; xmlns:wsu=&amp;quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&amp;quot;&lt;br /&gt; wsu:Id=&amp;quot;SigEncr&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;wsp:ExactlyOne&amp;gt;&lt;br /&gt;  &amp;lt;wsp:All&amp;gt;&lt;br /&gt;   &amp;lt;sp:SupportingTokens&lt;br /&gt;    xmlns:sp=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;     &amp;lt;sp:IssuedToken&lt;br /&gt;      sp:IncludeToken=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient&amp;quot;&amp;gt;&lt;br /&gt;      &amp;lt;Issuer xmlns=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy&amp;quot;&amp;gt;&lt;br /&gt;       &amp;lt;Address xmlns=&amp;quot;http://www.w3.org/2005/08/addressing&amp;quot;&amp;gt;&lt;br /&gt;        https://localhost:9443/services/wso2carbon-sts&lt;br /&gt;       &amp;lt;/Address&amp;gt;&lt;br /&gt;      &amp;lt;/Issuer&amp;gt;&lt;br /&gt;      &amp;lt;sp:RequestSecurityTokenTemplate&lt;br /&gt;       xmlns:t=&amp;quot;http://schemas.xmlsoap.org/ws/2005/02/trust&amp;quot;&amp;gt;&lt;br /&gt;       &amp;lt;t:TokenType&amp;gt;&lt;br /&gt;        urn:oasis:names:tc:SAML:1.0:assertion&amp;lt;/t:TokenType&amp;gt;&lt;br /&gt;       &amp;lt;t:KeyType&amp;gt;&lt;br /&gt;        http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey&lt;br /&gt;       &amp;lt;/t:KeyType&amp;gt;&lt;br /&gt;       &amp;lt;t:KeySize&amp;gt;256&amp;lt;/t:KeySize&amp;gt;&lt;br /&gt;       &amp;lt;t:Claims Dialect=&amp;quot;http://wso2.org/claims&amp;quot;&lt;br /&gt;        xmlns:ic=&amp;quot;http://schemas.xmlsoap.org/ws/2005/05/identity&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;ic:ClaimType Uri=&amp;quot;http://wso2.org/claims/givenname&amp;quot; /&amp;gt;&lt;br /&gt;       &amp;lt;/t:Claims&amp;gt;&lt;br /&gt;      &amp;lt;/sp:RequestSecurityTokenTemplate&amp;gt;&lt;br /&gt;      &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;       &amp;lt;sp:RequireInternalReference /&amp;gt;&lt;br /&gt;      &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;     &amp;lt;/sp:IssuedToken&amp;gt;&lt;br /&gt;    &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;   &amp;lt;/sp:SupportingTokens&amp;gt;&lt;br /&gt;  &amp;lt;/wsp:All&amp;gt;&lt;br /&gt; &amp;lt;/wsp:ExactlyOne&amp;gt;&lt;br /&gt;&amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-4288384332282715672?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/4288384332282715672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=4288384332282715672' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4288384332282715672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4288384332282715672'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/11/subject-confirmation-support-with.html' title='Subject Confirmation support with Apache Rampart : Holder-of-Key'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-7912315301145660031</id><published>2011-11-09T20:35:00.004+05:30</published><updated>2011-11-09T20:42:37.619+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security Patterns'/><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><title type='text'>Cross Domain Authentication Patterns - Kerberos with STS</title><content type='html'>&lt;table&gt;&lt;tr&gt;&lt;td&gt; &lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-QAl6T4lkmmY/TrqDp0OER4I/AAAAAAAAAxA/9E52fjjynys/s1600/Screen%2Bshot%2B2011-11-09%2Bat%2B7.12.08%2BPM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="340" src="http://4.bp.blogspot.com/-QAl6T4lkmmY/TrqDp0OER4I/AAAAAAAAAxA/9E52fjjynys/s640/Screen%2Bshot%2B2011-11-09%2Bat%2B7.12.08%2BPM.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;Business Requirements :&lt;br /&gt;&lt;br /&gt;1. Users from domain A - need to access a service in domain B&lt;br /&gt;2. Not all the users from domain A should be able to access the service in domain B [only a given group of users]&lt;br /&gt;3. Users are in a Windows domain and should be not asked again to enter any credentials to access the service in domain B&lt;br /&gt;&lt;br /&gt;What we need to achieve is..&lt;br /&gt;&lt;br /&gt;&lt;i&gt;&lt;b&gt;User logs in to his Windows machine and seamlessly accesses the service in domain B - with no additional authentication steps.&lt;/b&gt; &lt;/i&gt;&lt;br /&gt;&lt;br /&gt;Pattern - as per the diagram above..&lt;br /&gt;&lt;br /&gt;1 &amp;amp; 2 : User talks to Kerberos KDC [TGS] - authenticates and gets a Kerberos TGT. This communication with KDC happens underneath when user logs in to his Windows machine.&lt;br /&gt;&lt;br /&gt;3 &amp;amp; 4 : User program using the TGT, gets a Kerberos ticket to access the STS.&lt;br /&gt;&lt;br /&gt;5 &amp;amp; 6 : Using the Kerberos ticket issued to the user to access the STS - user program authenticates to STS and obtains a SAML token via WS-Trust. STS also carries out an authorization check to see whether the user is eligible to access the service in domain B.&lt;br /&gt;&lt;br /&gt;7 &amp;amp; 8 : User program uses the obtained SAML token to authenticate to the service in domain B. The service will validate that the token is issued from a trusted STS by verifying the signature.&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-7912315301145660031?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/7912315301145660031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=7912315301145660031' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7912315301145660031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7912315301145660031'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/11/cross-domain-authentication-patterns.html' title='Cross Domain Authentication Patterns - Kerberos with STS'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-QAl6T4lkmmY/TrqDp0OER4I/AAAAAAAAAxA/9E52fjjynys/s72-c/Screen%2Bshot%2B2011-11-09%2Bat%2B7.12.08%2BPM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-8200312897465037948</id><published>2011-11-09T02:23:00.005+05:30</published><updated>2011-11-09T02:39:02.600+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Carbon 3.2.2'/><category scheme='http://www.blogger.com/atom/ns#' term='Identity Server 3.2.2'/><category scheme='http://www.blogger.com/atom/ns#' term='XACML'/><title type='text'>Claim based authorization with WSO2 Identity Server</title><content type='html'>This blog post explains how to set up WSO2 Identity Server to do claim based authorization with XACML.&lt;br /&gt;&lt;br /&gt;1. Download WSO2 Identity Server latest version from &lt;a href="http://wso2.org/downloads/identity-server"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;2. The default user store of WSO2 Identity Server is running on an embedded ApacheDS server. In case you need to point it to an external LDAP server you can do it through a change in the configuration. &lt;a href="http://hasini-gunasinghe.blogspot.com/2011/09/integration-of-oracle-directory-server.html"&gt;This&lt;/a&gt; blog post explains how to integrate Oracle Directory Server as the User Store of WSO2 Identity Server.&lt;br /&gt;&lt;br /&gt;3. Start the WSO2 Identity Server from [IS_HOME]\bin&lt;br /&gt;&lt;br /&gt;4. Let's now define our authorization policy in plain English.&lt;br /&gt;&lt;br /&gt;"A given resource can be accessed only by any user having an email address from wso2 belonging to a particular role and all the requests to any other resource other than this should fail"&lt;br /&gt;&lt;br /&gt;5. Save the following policy in to a local file and import the file to WSO2 Identity Server XACML engine. Main --&amp;gt; Entitlement --&amp;gt; Administration --&amp;gt; Import New Entitlement Policy --&amp;gt; File System and import the policy. Then from policy list view click on the Enable button against the uploaded policy to enable the policy.&lt;br /&gt;&lt;pre class="html" name="code"&gt;&lt;policy policyid="claim_based_policy" rulecombiningalgid="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" xmlns="urn:oasis:names:tc:xacml:2.0:policy:schema:os"&gt;&lt;br /&gt;  &lt;rule effect="Permit" ruleid="permit_rule"&gt;&lt;br /&gt;    &lt;target&gt;&lt;br /&gt;      &lt;actions&gt;&lt;br /&gt;        &lt;action&gt;&lt;br /&gt;          &lt;actionmatch matchid="urn:oasis:names:tc:xacml:1.0:function:string-equal"&gt;&lt;br /&gt;            &lt;attributevalue datatype="http://www.w3.org/2001/XMLSchema#string"&gt;read&lt;/attributevalue&gt;&lt;br /&gt;            &lt;actionattributedesignator attributeid="urn:oasis:names:tc:xacml:1.0:action:action-id" datatype="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;          &lt;/actionattributedesignator&gt;&lt;br /&gt;        &lt;/actionmatch&gt;&lt;br /&gt;      &lt;/action&gt;&lt;br /&gt;      &lt;subjects&gt;&lt;br /&gt;        &lt;subject&gt;&lt;br /&gt;          &lt;subjectmatch matchid="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match"&gt;&lt;br /&gt;            &lt;attributevalue datatype="http://www.w3.org/2001/XMLSchema#string"&gt;@wso2.com$&lt;/attributevalue&gt;&lt;br /&gt;            &lt;subjectattributedesignator attributeid="http://wso2.org/claims/emailaddress" datatype="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;          &lt;/subjectattributedesignator&gt;&lt;br /&gt;        &lt;/subjectmatch&gt;&lt;br /&gt;      &lt;/subject&gt;&lt;br /&gt;    &lt;/subjects&gt;&lt;br /&gt;    &lt;condition&gt;&lt;br /&gt;      &lt;apply functionid="urn:oasis:names:tc:xacml:1.0:function:any-of"&gt;&lt;br /&gt;        &lt;function functionid="urn:oasis:names:tc:xacml:1.0:function:string-equal"&gt;&lt;br /&gt;        &lt;attributevalue datatype="http://www.w3.org/2001/XMLSchema#string"&gt;admin&lt;/attributevalue&gt;&lt;br /&gt;        &lt;subjectattributedesignator attributeid="http://wso2.org/claims/role" datatype="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;      &lt;/subjectattributedesignator&gt;&lt;br /&gt;    &lt;/function&gt;&lt;br /&gt;  &lt;/apply&gt;&lt;br /&gt;  &lt;rule effect="Deny" ruleid="deny_rule"&gt;&lt;br /&gt;  &lt;target&gt;&lt;br /&gt;    &lt;resources&gt;&lt;br /&gt;      &lt;resource&gt;&lt;br /&gt;        &lt;resourcematch matchid="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match"&gt;&lt;br /&gt;          &lt;attributevalue datatype="http://www.w3.org/2001/XMLSchema#string"&gt;http://localhost:8080/services/echo/&lt;/attributevalue&gt;&lt;br /&gt;          &lt;resourceattributedesignator attributeid="urn:oasis:names:tc:xacml:1.0:resource:resource-id" datatype="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;        &lt;/resourceattributedesignator&gt;&lt;br /&gt;      &lt;/resourcematch&gt;&lt;br /&gt;    &lt;/resource&gt;&lt;br /&gt;  &lt;/resources&gt;&lt;br /&gt;&lt;/target&gt;&lt;/rule&gt;&lt;/condition&gt;&lt;/actions&gt;&lt;/target&gt;&lt;/rule&gt;&lt;/policy&gt;&lt;/pre&gt;6. Looking at the policy, you might have noticed that, I have used the claim http://wso2.org/claims/emailaddress. And, this should map to the attribute id, corresponding to the email, in the underlying user store. If it is LDAP then, http://wso2.org/claims/emailaddress should map to the 'mail' attribute id. This is done through the Claim Management UI,&lt;br /&gt;&lt;br /&gt;7. Configure --&amp;gt; Claim Management --&amp;gt; http://wso2.org/claims&lt;br /&gt;&lt;br /&gt;8. Now you can see all the claims used under wso2.org dialect&lt;br /&gt;&lt;br /&gt;9. Click on Edit link against any of the claims you want to update and then set the "Mapped Attribute" value to the, attribute id name from the underlying user store.&lt;br /&gt;&lt;br /&gt;10. You can try the policy we defined, from the Entitlement TryIt tool. Main --&amp;gt; Entitlement --&amp;gt; TryIt.&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-wskU40a9q3A/TrmZW1xqAeI/AAAAAAAAAwo/9h-i_CVqA6k/s1600/Screen%2Bshot%2B2011-11-09%2Bat%2B2.33.13%2BAM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-wskU40a9q3A/TrmZW1xqAeI/AAAAAAAAAwo/9h-i_CVqA6k/s1600/Screen%2Bshot%2B2011-11-09%2Bat%2B2.33.13%2BAM.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-8200312897465037948?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/8200312897465037948/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=8200312897465037948' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8200312897465037948'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8200312897465037948'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/11/claim-based-authorization-with-wso2.html' title='Claim based authorization with WSO2 Identity Server'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-wskU40a9q3A/TrmZW1xqAeI/AAAAAAAAAwo/9h-i_CVqA6k/s72-c/Screen%2Bshot%2B2011-11-09%2Bat%2B2.33.13%2BAM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-2506444818053743400</id><published>2011-11-07T17:05:00.044+05:30</published><updated>2011-11-16T14:04:31.798+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='ApacheCon'/><title type='text'>ApacheCon Vancouver : Training on Web Services Security</title><content type='html'>Today is the first day at ApacheCon 2011 @ Vancouver - Canada.&lt;br /&gt;&lt;br /&gt;My training on Web Services Security started around 2.30 in the afternoon.&lt;br /&gt;&lt;br /&gt;First part was a presentation on different security patterns and standards - then started digging in to the Rampart code.&lt;br /&gt;&lt;br /&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.slideshare.net/prabathsiriwardena/web-service-security-10069918" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-aBltwhDnlgY/TsN0RyNp3sI/AAAAAAAAAxY/whcM1nnqnq4/s1600/Screen%2Bshot%2B2011-11-16%2Bat%2B1.56.04%2BPM.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt; All the samples I used are available &lt;a href="https://svn.wso2.org/repos/wso2/people/prabath/apachecon2011"&gt;here&lt;/a&gt;. You can use a simple SVN client to get that code. It comes as Eclipse projects and when loaded in to an Eclipse workspace, just set the SAMPLES_HOME environment variable in ECLIPSE to the root of the downloaded code - it should build fine then...  Following are some of the resources that you can look in to..  &lt;br /&gt;&lt;p&gt;1. &lt;a href="http://blog.rampartfaq.com/"&gt;http://RampartFAQ.com&lt;/a&gt;  &lt;br /&gt;2. &lt;a href="http://wso2.org/library/3132"&gt;Understanding WS – Security Policy Language&lt;/a&gt;  &lt;br /&gt;3. &lt;a href="http://wso2.org/library/3786"&gt;Applying policies at binding hierarchy&lt;/a&gt;   &lt;br /&gt;4. &lt;a href="http://wso2.org/library/3733"&gt;Password Callback Handlers Explained&lt;/a&gt; &lt;br /&gt;5. SAML &lt;a href="http://fusionsecurity.blogspot.com/2009/09/bearer-confirmation-method-huh-what-is.html"&gt;Bearer Confirmation Method&lt;/a&gt;, &lt;a href="http://help.sap.com/saphelp_nwpi71/helpdata/en/44/322225a52d5447e10000000a422035/content.htm"&gt;Sender Vouches&lt;/a&gt; &amp;amp; &lt;a href="http://download.oracle.com/docs/cd/E17802_01/webservices/webservices/docs/1.6/tutorial/doc/XWS-SecuritySamples7.html"&gt;Holder-of-Key&lt;/a&gt;  &lt;br /&gt;6. &lt;a href="http://blog.thilinamb.com/2009/08/identity-delegation-in-ws-trust-14.html"&gt;Identity Delegation in WS Trust 1.4&lt;/a&gt;  &lt;br /&gt;7. &lt;a href="http://thilinamb.wordpress.com/2009/08/19/ws-security-policy-assymetric-binding-explained/"&gt;WS Security Policy – Asymmetric Binding Explained&lt;/a&gt; &lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-2506444818053743400?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/2506444818053743400/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=2506444818053743400' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2506444818053743400'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2506444818053743400'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/11/apachecon-vancouver-tarining-on-web.html' title='ApacheCon Vancouver : Training on Web Services Security'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-aBltwhDnlgY/TsN0RyNp3sI/AAAAAAAAAxY/whcM1nnqnq4/s72-c/Screen%2Bshot%2B2011-11-16%2Bat%2B1.56.04%2BPM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-4018093214845378676</id><published>2011-10-28T03:19:00.001+05:30</published><updated>2011-10-28T03:20:31.683+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Cloud'/><title type='text'>Cloud Security Videos</title><content type='html'>&lt;iframe width="420" height="315" src="http://www.youtube.com/embed/EeYUhwmagBY" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe width="420" height="315" src="http://www.youtube.com/embed/IwHW91sD9ZA" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe width="420" height="315" src="http://www.youtube.com/embed/Tt09qFeZF0Y" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe width="420" height="315" src="http://www.youtube.com/embed/2nD3sOFSG9M" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-4018093214845378676?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/4018093214845378676/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=4018093214845378676' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4018093214845378676'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4018093214845378676'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/10/cloud-security-videos.html' title='Cloud Security Videos'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/EeYUhwmagBY/default.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-6901742411152863237</id><published>2011-10-28T03:09:00.006+05:30</published><updated>2011-11-16T14:08:27.091+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='Open Source'/><title type='text'>Open Source for Cyber Security</title><content type='html'>@4th Annual National Conference on Cyber Security, Colombo&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.slideshare.net/prabathsiriwardena/open-source-for-cyber-security" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-hsfejuIE3Io/TsN2LlIGg1I/AAAAAAAAAxk/nJdF2iLg9NI/s1600/Screen%2Bshot%2B2011-11-16%2Bat%2B2.05.47%2BPM.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-6901742411152863237?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/6901742411152863237/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=6901742411152863237' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6901742411152863237'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6901742411152863237'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/10/open-source-for-cyber-security.html' title='Open Source for Cyber Security'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-hsfejuIE3Io/TsN2LlIGg1I/AAAAAAAAAxk/nJdF2iLg9NI/s72-c/Screen%2Bshot%2B2011-11-16%2Bat%2B2.05.47%2BPM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-3045157066925956367</id><published>2011-10-28T03:04:00.003+05:30</published><updated>2011-11-16T14:14:19.218+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cloud'/><category scheme='http://www.blogger.com/atom/ns#' term='Webinar'/><title type='text'>"Security in the Cloud" - Webinar</title><content type='html'>&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.slideshare.net/prabathsiriwardena/security-in-the-cloud-9913244" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-1Nt-QLYg924/TsN3n-GLYJI/AAAAAAAAAxw/r_XzGOTvpMc/s1600/Screen%2Bshot%2B2011-11-16%2Bat%2B2.11.47%2BPM.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-3045157066925956367?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/3045157066925956367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=3045157066925956367' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3045157066925956367'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3045157066925956367'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/10/security-in-cloud-webinar.html' title='&quot;Security in the Cloud&quot; - Webinar'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-1Nt-QLYg924/TsN3n-GLYJI/AAAAAAAAAxw/r_XzGOTvpMc/s72-c/Screen%2Bshot%2B2011-11-16%2Bat%2B2.11.47%2BPM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-4130849855996327270</id><published>2011-09-15T08:05:00.001+05:30</published><updated>2011-12-21T01:01:36.668+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSO2Con2011'/><title type='text'>"Security in Practice" @ WSO2Con 2011</title><content type='html'>&lt;div style="width:425px" id="__ss_9261921"&gt;&lt;object id="__sse9261921" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=security-110914212323-phpapp01&amp;stripped_title=security-in-practice&amp;userName=prabathsiriwardena" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed name="__sse9261921" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=security-110914212323-phpapp01&amp;stripped_title=security-in-practice&amp;userName=prabathsiriwardena" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="padding:5px 0 12px"&gt;View more &lt;a href="http://www.slideshare.net/"&gt;presentations&lt;/a&gt; from &lt;a href="http://www.slideshare.net/prabathsiriwardena"&gt;Prabath Siriwardena&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;&lt;iframe width="420" height="315" src="http://www.youtube.com/embed/FMMosN8BCWc" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-4130849855996327270?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/4130849855996327270/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=4130849855996327270' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4130849855996327270'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4130849855996327270'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/09/security-in-practice-wso2con-2011.html' title='&quot;Security in Practice&quot; @ WSO2Con 2011'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/FMMosN8BCWc/default.jpg' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-7566429929228736049</id><published>2011-09-15T07:59:00.002+05:30</published><updated>2011-09-15T08:01:33.733+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSO2Con2011'/><title type='text'>Facebook unfriend app demoed during the second day of WSO2Con</title><content type='html'>It's was a perfect demo on &lt;a href="http://stratoslive.wso2.com"&gt;WSO2 StratosLive&lt;/a&gt; [Java PaaS] by Shankar which included developing and deploying cloud applications in front of a huge audience. Everything went perfect and Shankar was honored with a thundering applause.&lt;br /&gt;&lt;br /&gt;During his demo, Shankar also demonstrated the "&lt;a href="http://tinyurl.com/stratos-unfriend"&gt;Catch who didn't match you&lt;/a&gt;" application - which let you find who unfriended you in Facebook.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-cg7Xil3sJ7w/TnFihJNfP2I/AAAAAAAAAuc/mYkUgE3IaqM/s1600/Screen%2Bshot%2B2011-09-14%2Bat%2B7.57.28%2BPM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="392" src="http://3.bp.blogspot.com/-cg7Xil3sJ7w/TnFihJNfP2I/AAAAAAAAAuc/mYkUgE3IaqM/s640/Screen%2Bshot%2B2011-09-14%2Bat%2B7.57.28%2BPM.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-7566429929228736049?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/7566429929228736049/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=7566429929228736049' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7566429929228736049'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7566429929228736049'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/09/facebook-unfriend-app-demoed-during.html' title='Facebook unfriend app demoed during the second day of WSO2Con'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-cg7Xil3sJ7w/TnFihJNfP2I/AAAAAAAAAuc/mYkUgE3IaqM/s72-c/Screen%2Bshot%2B2011-09-14%2Bat%2B7.57.28%2BPM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-486071613487328896</id><published>2011-09-12T06:12:00.005+05:30</published><updated>2011-09-12T06:26:31.315+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSO2'/><category scheme='http://www.blogger.com/atom/ns#' term='Facebook'/><category scheme='http://www.blogger.com/atom/ns#' term='Stratos'/><title type='text'>"Catch Who Didn't Match You..." - Facebook unfriend finder on WSO2 StratosLive...!!!</title><content type='html'>The word "unfriend" was named as the word of year 2009 by the Oxford Dictionary.&lt;blockquote&gt;&lt;b&gt;unfriend&lt;/b&gt; – verb – To remove someone as a ‘friend’ on a social networking site such as Facebook.&lt;br /&gt;&lt;/blockquote&gt;The Facebook, the most popular social networking site, doesn't offer a straight forward way to figure out who removed you there.&lt;br /&gt;&lt;br /&gt;The "Catch Who Didn't Match You" application caters exactly that. Currently it's running on WSO2 StrtosLive PAAS and backed by a highly scalable cassandra NoSQL data store - available via &lt;a href="http://tinyurl.com/stratos-unfriend"&gt;http://tinyurl.com/stratos-unfriend&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-AvaCQ3a6x4Q/Tm1UlD7xLLI/AAAAAAAAAuE/B3UYeJh4UYA/s1600/Screen%2Bshot%2B2011-09-11%2Bat%2B11.24.08%2BPM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="496" src="http://1.bp.blogspot.com/-AvaCQ3a6x4Q/Tm1UlD7xLLI/AAAAAAAAAuE/B3UYeJh4UYA/s640/Screen%2Bshot%2B2011-09-11%2Bat%2B11.24.08%2BPM.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-zX7DXi3San8/Tm1UldreqbI/AAAAAAAAAuU/zf3nKAcGfjI/s1600/Screen%2Bshot%2B2011-09-11%2Bat%2B11.27.13%2BPM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="516" src="http://3.bp.blogspot.com/-zX7DXi3San8/Tm1UldreqbI/AAAAAAAAAuU/zf3nKAcGfjI/s640/Screen%2Bshot%2B2011-09-11%2Bat%2B11.27.13%2BPM.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://3.bp.blogspot.com/-bjXnBdrwZ74/Tm1Uk_MocrI/AAAAAAAAAt8/rfI9Ep4v0Bc/s1600/Screen%2Bshot%2B2011-09-11%2Bat%2B11.23.55%2BPM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="451" src="http://3.bp.blogspot.com/-bjXnBdrwZ74/Tm1Uk_MocrI/AAAAAAAAAt8/rfI9Ep4v0Bc/s640/Screen%2Bshot%2B2011-09-11%2Bat%2B11.23.55%2BPM.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://4.bp.blogspot.com/-bsjw7hQgmhw/Tm1Ula8_wkI/AAAAAAAAAuM/qYfy37kNSdQ/s1600/Screen%2Bshot%2B2011-09-11%2Bat%2B11.26.06%2BPM.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="553" src="http://4.bp.blogspot.com/-bsjw7hQgmhw/Tm1Ula8_wkI/AAAAAAAAAuM/qYfy37kNSdQ/s640/Screen%2Bshot%2B2011-09-11%2Bat%2B11.26.06%2BPM.png" width="640" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-486071613487328896?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/486071613487328896/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=486071613487328896' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/486071613487328896'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/486071613487328896'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/09/catch-who-didnt-match-you-facebook.html' title='&quot;Catch Who Didn&apos;t Match You...&quot; - Facebook unfriend finder on WSO2 StratosLive...!!!'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-AvaCQ3a6x4Q/Tm1UlD7xLLI/AAAAAAAAAuE/B3UYeJh4UYA/s72-c/Screen%2Bshot%2B2011-09-11%2Bat%2B11.24.08%2BPM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-8489656620909009544</id><published>2011-08-24T18:22:00.002+05:30</published><updated>2011-08-24T18:22:35.243+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSO2'/><category scheme='http://www.blogger.com/atom/ns#' term='Identity Server 3.2.0'/><title type='text'>The WSO2 Identity Server @ NBQSA 2011</title><content type='html'>&lt;div style="width:425px" id="__ss_8991204"&gt;&lt;strong style="display:block;margin:12px 0 4px"&gt;&lt;object id="__sse8991204" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=wso2is-110824074418-phpapp02&amp;stripped_title=wso2-identity-server&amp;userName=prabathsiriwardena" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed name="__sse8991204" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=wso2is-110824074418-phpapp02&amp;stripped_title=wso2-identity-server&amp;userName=prabathsiriwardena" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-8489656620909009544?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/8489656620909009544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=8489656620909009544' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8489656620909009544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8489656620909009544'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/08/wso2-identity-server-nbqsa-2011.html' title='The WSO2 Identity Server @ NBQSA 2011'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-6878612525801458255</id><published>2011-08-24T12:02:00.004+05:30</published><updated>2011-08-24T12:19:49.023+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSO2'/><category scheme='http://www.blogger.com/atom/ns#' term='WSO2Con2011'/><title type='text'>The SMALL miracle, ready for her BIGGEST IT event forever</title><content type='html'>As any of the WSO2ers, me too excited...&lt;br /&gt;&lt;br /&gt;Internal mailing lists getting busier and busier.. plenty of suggestions... thoughts... and ideas... everyone talking about making the WSO2Con an unique - unmatched experience.&lt;br /&gt;&lt;br /&gt;This is not just the BIGGEST event WSO2 has ever organized, but the BIGGEST IT event in Sri Lanka..&lt;br /&gt;&lt;br /&gt;WSO2Con happened to be an annual event since our 5th anniversary last year and this is the first time we've added 'international' flavor on it.&lt;br /&gt;&lt;br /&gt;It's non-second to ApacheCon..&lt;br /&gt;&lt;br /&gt;It's non-second to OSCON...&lt;br /&gt;&lt;br /&gt;WSO2Con this year, features more than 30 experienced speakers around the world, from more than ten countries.&lt;br /&gt;&lt;br /&gt;Dr. Mohan from IBM, Sastry Malladi from eBAy, Gregor Hohpe from Google are few to name among them.&lt;br /&gt;&lt;br /&gt;Dr. C. Mohan has been an IBM researcher for 30 years in the information management area, impacting numerous IBM and non-IBM products, the research community and standards, especially with his invention of the ARIES family of locking and recovery algorithms, and the Presumed Abort commit protocol. &lt;br /&gt;&lt;br /&gt;This IBM, ACM and IEEE Fellow has also served as the IBM India Chief Scientist. In addition to receiving the ACM SIGMOD Innovation Award, the VLDB 10 Year Best Paper Award and many IBM awards, he has been elected to the US and Indian National Academies of Engineering, and has been named an IBM Master Inventor. This distinguished alumnus of IIT Madras received his PhD at the University of Texas at Austin. He is an inventor of 36 patents. He serves on the advisory board of IEEE Spectrum and on the IBM Software Group Architecture Board’s Council.&lt;br /&gt;&lt;br /&gt;Sastry is a technology evangelist with over 20 years of experience in architecting and building scalable distributed computing systems, in the areas of Application Servers, Java/J2EE/Web Services, SOA and Grid Computing. He is currently a Distinguished Architect at eBay, driving the SOA architecture and platform for the eBay ecommerce platform. &lt;br /&gt;&lt;br /&gt;Prior to joining eBay, Sastry was Co-Founder and CTO of OpenGridSolutions, Founding member and Architect at SpikeSource, and an Architect at Oracle. Sastry also worked at many other companies in the early stages of his career and holds a Masters degree from I.I.T, Kharagpur, India. Sastry has presented at many conferences including JavaOne, Oracle World, SOA world and IONA world to name a few. He is a contributor to many standards at OMG, JCP, GGF and OASIS.&lt;br /&gt;&lt;br /&gt;Gregor Hohpe is a Staff Software Engineer with Google. As a widely recognized thought leader on asynchronous messaging and service-oriented architectures. he co-authored the seminal book ‘Enterprise Integration Patterns’ (Addison-Wesley, 2004) and contributed to a variety of publications, including “97 Things Every Architect Should Know”. In 2005, Joel Spolsky selected Gregor’s article ‘Starbucks Does Not Use Two-phase Commit’ for his ‘Best Software Writing’. Find out more about his work at eaipatterns.com.&lt;br /&gt;&lt;br /&gt;Doesn't this provide enough excitement to attend WSO2Con this year..? Here comes more.. :-)&lt;br /&gt;&lt;br /&gt;It's in Sri Lanka - the 'small miracle' - surrounded with beautiful blue ocean, rich with enchanting natural beauty and smiles all-around from a nation renowned for great hospitality.&lt;br /&gt;&lt;br /&gt;&lt;iframe width="420" height="345" src="http://www.youtube.com/embed/MT0e3Lw9_lc" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;Also the biggest book fair in Sri Lanka, with hundreds of international publishers, will commence just after the WSO2Con - on 17th September - and will be within 5 kilometers from the conference center. This year it's the 13th Colombo International Book Fair and so far, every-time - this attracted crowds going beyond hundred thousands.&lt;br /&gt;&lt;br /&gt;More news on WSO2Con to follow.. please keep tune in...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-6878612525801458255?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/6878612525801458255/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=6878612525801458255' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6878612525801458255'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6878612525801458255'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/08/colombo-ready-for-biggest-it-event-in.html' title='The SMALL miracle, ready for her BIGGEST IT event forever'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/MT0e3Lw9_lc/default.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-8899009403752863848</id><published>2011-07-07T07:43:00.000+05:30</published><updated>2011-07-07T07:43:38.190+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='ApacheCon'/><title type='text'>ApacheCon 2011 : Web Services Security - Patterns, Practices and Threats</title><content type='html'>I'll be conducting a training on "&lt;a href="http://na11.apachecon.com/talks/18504"&gt;Web Services Security - Patterns, Practices and Threats&lt;/a&gt;" at ApacheCon this time. Would be on 7th November from 2.30 PM to 5.30 PM. If you are planning to attend ApacheCon, now it's open for registration.&lt;br /&gt;&lt;br /&gt;During this session I'll be covering the practical importance of security standards like, WS-Security, WS-Security Policy, WS-Trust and risks associated with those. Further the session will cover patterns, best practices and threats associated with SOA security models.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-8899009403752863848?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/8899009403752863848/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=8899009403752863848' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8899009403752863848'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8899009403752863848'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/07/apachecon-2011-web-services-security.html' title='ApacheCon 2011 : Web Services Security - Patterns, Practices and Threats'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-8150266381811525495</id><published>2011-07-06T17:13:00.020+05:30</published><updated>2011-07-06T18:18:02.289+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='OAuth'/><category scheme='http://www.blogger.com/atom/ns#' term='XACML'/><category scheme='http://www.blogger.com/atom/ns#' term='Identity Server 3.2.0'/><title type='text'>Integrating 3-legged OAuth with XACML</title><content type='html'>This blog post explains in detail how to integrate 3-legged OAuth with XACML. Detailed  explanations on OAuth and XACML are out of scope.&lt;br /&gt;&lt;br /&gt;You need to download following products to get the sample running.&lt;br /&gt;&lt;br /&gt;1. WSO2 Identity Server - acting as the service provider, where a user can register an OAuth consumer app to obtain a request token, authorize it and obtain an access token. Also WSO2 Identity Server is used as the XACML engine. Identity Server can be downloaded from &lt;a href="http://wso2.org/products/download/solutions/identity/3.2.0/wso2is-3.2.0.zip"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;2. WSO2 ESB - acting as an interceptor to the final resource the consumer wants to access. ESB will intercept the request and performs OAuth validation. WSO2 ESB can be downloaded from &lt;a href="http://wso2.org/products/download/esb/java/4.0.0/wso2esb-4.0.0.zip"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;3. WSO2 Application Server - this is used to host WSO2 OAuth Playground web app. App Server can be downloaded from &lt;a href="http://wso2.org/products/download/appserver/4.1.0/wso2as-4.1.0.zip"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;4. Download and unzip the sample from &lt;a href="http://people.wso2.com/~prabath/oauth_sample.zip"&gt;here&lt;/a&gt; to OAUTH_SAMPLE.&lt;br /&gt;&lt;b&gt;&lt;br /&gt;Let's first start by setting up the WSO2 Identity Server.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;1. Unzip the downloaded copy of Identity Server and remove all jars starting with org.wso2.carbon.identity.oauth inside [IS_HOME]\reposiroty\components\plugins&lt;br /&gt;&lt;br /&gt;2. Copy following jars from OAUTH_SAMPLE\dropins to [IS_HOME]\reposiroty\components\dropins&lt;br /&gt;org.wso2.carbon.identity.oauth-3.2.1.jar&lt;br /&gt;org.wso2.carbon.identity.oauth.stub-3.2.1.jar&lt;br /&gt;org.wso2.carbon.identity.oauth.ui-3.2.1.jar&lt;br /&gt;&lt;br /&gt;3. Above [1] &amp;amp; [2] steps are not required when OAuth 3.2.1 feature is available in WSO2 feature repo - you can simply point there and update.&lt;br /&gt;&lt;br /&gt;4. Start WSO2 Identity Server&lt;br /&gt;&lt;br /&gt;5. Login as admin/admin and go to OAuth and register a consumer application. When creating the application make sure you give http://localhost:9767/playground/oauth/oauth_callback as the callback url. This is the location we are going to setup our sample web app later.&lt;br /&gt;&lt;br /&gt;6. Also - once created the app - click on the link under you application name - there you can see the corresponding consumer key and the consumer secret for your app.&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="left: both; text-align: left;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-jcVQSB9Yamc/ThRCaAOA2hI/AAAAAAAAAsI/JutehVCSNIE/s1600/Screen%2Bshot%2B2011-07-06%2Bat%2B3.02.35%2BPM.png" /&gt;&lt;/div&gt;&lt;br /&gt;7. Now we need to setup the XACML engine in WSO2 Identity Server&lt;br /&gt;&lt;br /&gt;9. Go to Entitlement --&amp;gt; Administration --&amp;gt; Import Policy --&amp;gt; Select file system and import the policy OAUTH_SAMPLE/xacml.policy&lt;br /&gt;&lt;br /&gt;10. Once imported - make sure you click on the ENABLE link against the imported policy.&lt;br /&gt;&lt;br /&gt;11. That completes the Identity Server setup.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Now, let's setup WSO2 ESB.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;1. Unzip the downloaded copy of WSO2 ESB and remove all jars starting with org.wso2.carbon.identity.oauth inside [ESB_HOME]\reposiroty\components\plugins&lt;br /&gt;&lt;br /&gt;2. Copy following jars from OAUTH_SAMPLE\dropins to [ESB_HOME]\reposiroty\components\dropins&lt;br /&gt;org.wso2.carbon.identity.oauth.mediator-3.2.1.jar&lt;br /&gt;org.wso2.carbon.identity.oauth.stub-3.2.1.jar&lt;br /&gt;&lt;br /&gt;3. Above [1] &amp;amp; [2] steps are not required when OAuth 3.2.1 feature is available in WSO2 feature repo - you can simply point there and update.&lt;br /&gt;&lt;br /&gt;4. Open ESB_HOME\repository\conf\carbon.xml and find for the element Offset and set it to 2.&lt;br /&gt;This will make sure that ESB starts on ports 9445/9765.&lt;br /&gt;&lt;br /&gt;5. Start WSO2 ESB&lt;br /&gt;&lt;br /&gt;6. Login as admin/admin and replace the synapse configuration in the source view - with the content from OAUTH_SAMPLE\synapse.xml&lt;br /&gt;&lt;br /&gt;7. That's it and we are done with the ESB.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Let's set up the sample web app with WSO2 Application Server.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;1. Open AS_HOME\repository\conf\carbon.xml and find for the element Offset and set it to 4.&lt;br /&gt;This will make sure that App Server starts on ports 9447/9767.&lt;br /&gt;&lt;br /&gt;2. Copy OAUTH_SAMPLE\playground.war to AS_HOME\repository\deployment\server\webapps&lt;br /&gt;&lt;br /&gt;3. Start WSO2 Application Server&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Now let's see how web app works.&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;1. Go to http://localhost:9767/playground&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;img border="0" src="http://3.bp.blogspot.com/-HTjHQ86a9hw/ThRRn6hJFQI/AAAAAAAAAsQ/fO0xni1YZI0/s1600/Screen%2Bshot%2B2011-07-06%2Bat%2B5.43.04%2BPM.png" /&gt;&lt;/div&gt;&lt;br /&gt;2. To get the request token, type your consumer key and consumer secret corresponding to your registered oauth application. Set the scope as echoService [should be the exact name, since that is what is been referred in the XACML policy].&lt;br /&gt;&lt;br /&gt;3. Once you get the request token, you need to get that authorized by the user.&lt;br /&gt;&lt;br /&gt;4. After that you can exchange the authorized token to an access token.&lt;br /&gt;&lt;br /&gt;5. Copy the value of oauth_token from the response to [4] - we need this value when we are going to access the resource.&lt;br /&gt;&lt;br /&gt;Now let's try to invoke a service with the obtained access token. Following java code explains how to do that. You need replace the values of CONSUMER_SECRET,CONSUMER_KEY and OAUTH_TOKEN. The value of OAUTH_TOKEN is the one you got with the access token.&lt;br /&gt;&lt;pre class="java" name="code"&gt;package org.wso2.rest.security.oauth;&lt;br /&gt;&lt;br /&gt;import java.io.BufferedReader;&lt;br /&gt;import java.io.IOException;&lt;br /&gt;import java.io.InputStream;&lt;br /&gt;import java.io.InputStreamReader;&lt;br /&gt;import java.net.URL;&lt;br /&gt;&lt;br /&gt;import com.google.gdata.client.GoogleService;&lt;br /&gt;import com.google.gdata.client.Service.GDataRequest;&lt;br /&gt;import com.google.gdata.client.authn.oauth.GoogleOAuthParameters;&lt;br /&gt;import com.google.gdata.client.authn.oauth.OAuthHmacSha1Signer;&lt;br /&gt;&lt;br /&gt;public class OauthClient {&lt;br /&gt;&lt;br /&gt; private static final String ESB = "http://127.0.0.1:8280/";&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * @param args&lt;br /&gt;  */&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;&lt;br /&gt;  final String CONSUMER_SECRET = "9FXwlWNQdUlG2rWk7os3VRz8dfsa";&lt;br /&gt;  final String CONSUMER_KEY = "yumx9s1HAf1iaItr1UZw4afEEjga";&lt;br /&gt;  final String OAUTH_TOKEN = "hfiYq1ppu3VhLsFWxpFjCUDc3Jwa";&lt;br /&gt;&lt;br /&gt;  GDataRequest request = null;&lt;br /&gt;&lt;br /&gt;  try {&lt;br /&gt;&lt;br /&gt;   GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters();&lt;br /&gt;   oauthParameters.setOAuthConsumerKey(CONSUMER_KEY);&lt;br /&gt;   oauthParameters.setOAuthConsumerSecret(CONSUMER_SECRET);&lt;br /&gt;   oauthParameters.setOAuthToken(OAUTH_TOKEN);&lt;br /&gt;&lt;br /&gt;   OAuthHmacSha1Signer signer = new OAuthHmacSha1Signer();&lt;br /&gt;   GoogleService service = new GoogleService("demoservice", "myapp");&lt;br /&gt;   service.setOAuthCredentials(oauthParameters, signer);&lt;br /&gt;   String param = "hi";&lt;br /&gt;   String baseString = ESB + "services/oauth_proxy/echoString" + "?xoauth_requestor_id="&lt;br /&gt;     + CONSUMER_KEY + "&amp;amp;in=" + param + "&amp;amp;scope=echoService";&lt;br /&gt;   URL feedUrl = new URL(baseString);&lt;br /&gt;   request = service.createFeedRequest(feedUrl);&lt;br /&gt;   request.execute();&lt;br /&gt;   System.out.println(convertStreamToString(request.getResponseStream()));&lt;br /&gt;  } catch (Exception e) {&lt;br /&gt;   e.printStackTrace();&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private static String convertStreamToString(InputStream is) throws IOException {&lt;br /&gt;  if (is != null) {&lt;br /&gt;   StringBuilder sb = new StringBuilder();&lt;br /&gt;   String line;&lt;br /&gt;   try {&lt;br /&gt;    BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));&lt;br /&gt;    while ((line = reader.readLine()) != null) {&lt;br /&gt;     sb.append(line).append("\n");&lt;br /&gt;    }&lt;br /&gt;   } finally {&lt;br /&gt;    is.close();&lt;br /&gt;   }&lt;br /&gt;   return sb.toString();&lt;br /&gt;  } else {&lt;br /&gt;   return "";&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;To run the above client you need to have &lt;a href="http://dist.wso2.org/snapshots/maven2/com/google/common/wso2/google-collect/1.0.0.wso2v1/google-collect-1.0.0.wso2v1.jar"&gt;google-collect&lt;/a&gt; and &lt;a href="http://dist.wso2.org/maven2/com/google/gdata/wso2/gdata-core/1.0.0.wso2v1/gdata-core-1.0.0.wso2v1.jar"&gt;gdata-core&lt;/a&gt; jars in your classpath.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-8150266381811525495?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/8150266381811525495/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=8150266381811525495' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8150266381811525495'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8150266381811525495'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/07/integrating-3-legged-oauth-with-xacml.html' title='Integrating 3-legged OAuth with XACML'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-jcVQSB9Yamc/ThRCaAOA2hI/AAAAAAAAAsI/JutehVCSNIE/s72-c/Screen%2Bshot%2B2011-07-06%2Bat%2B3.02.35%2BPM.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-7583721538050452805</id><published>2011-04-23T09:05:00.002+05:30</published><updated>2011-04-23T09:05:54.360+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Webinar'/><category scheme='http://www.blogger.com/atom/ns#' term='XACML'/><title type='text'>Fine-grained Authorization with XACML</title><content type='html'>&lt;div style="width:425px" id="__ss_7709777"&gt;&lt;object id="__sse7709777" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=entitlementwithxacmlwebinar-110422210310-phpapp01&amp;stripped_title=finegrained-authorization-with-xacml&amp;userName=prabathsiriwardena" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed name="__sse7709777" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=entitlementwithxacmlwebinar-110422210310-phpapp01&amp;stripped_title=finegrained-authorization-with-xacml&amp;userName=prabathsiriwardena" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-7583721538050452805?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/7583721538050452805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=7583721538050452805' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7583721538050452805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7583721538050452805'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/04/fine-grained-authorization-with-xacml.html' title='Fine-grained Authorization with XACML'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-7383547510692247837</id><published>2011-04-21T19:43:00.012+05:30</published><updated>2011-07-06T01:03:33.119+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSO2'/><category scheme='http://www.blogger.com/atom/ns#' term='Carbon 3.2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='XACML'/><category scheme='http://www.blogger.com/atom/ns#' term='Identity Server'/><title type='text'>XACML Policy Information Point Extensions &amp; Designators with WSO2 Identity Server 3.2.0</title><content type='html'>WSO2 Identity Server 3.2.0 release provides two types of extensions to it's XACML PIP. [The release is not yet done - you can download a build from the latest trunk from &lt;a href="http://people.wso2.com/~prabath/wso2is-3.2.0-SNAPSHOT.zip"&gt;here&lt;/a&gt;]&lt;br /&gt;&lt;br /&gt;1.PIP Extensions&lt;br /&gt;&lt;br /&gt;Once the PIP Extensions got registered with the system - the registered PIP Extension will be invoked for each and every XACML request the PDP receives and this happens before the request been evaluated.&lt;br /&gt;&lt;br /&gt;PIP Extensions can be used to modify the incoming request as well as log relavent parameters.&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-VC-FlznySzo/TbA4DmTgRpI/AAAAAAAAAr8/vUDUvJb3ASo/s1600/Screen%2Bshot%2B2011-04-21%2Bat%2B7.26.35%2BPM.png" /&gt;&lt;br /&gt;&lt;br /&gt;2.PIP Desiginators.&lt;br /&gt;&lt;br /&gt;Once the PIP Desiginators got registered with the system - the registered Desiginators will be invoked while a request been evaluated in the PDP and need to find out the value of an attribute which is supported by the Desiginator. The Desiginator will let the system know the attributes it supports at the time of registration.&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-h53LJt1qWkM/TbA3xlY0cII/AAAAAAAAAr0/lmZhaIqLTNw/s1600/Screen%2Bshot%2B2011-04-21%2Bat%2B7.26.49%2BPM.png" /&gt;&lt;br /&gt;&lt;br /&gt;To register a PIP Extension or a PIP Designator we need to copy the jars with those classes to [CARBON_HOME]\repository\components\lib and create a file called &lt;b&gt;pip-config.xml&lt;/b&gt; inside [CARBON_HOME]\repository\conf with the following. Here I assume the PIP Extension class name is org.wso2.carbon.identity.sample.pip.SamplePIPExtension and PIP Designator class name is org.wso2.carbon.identity.sample.pip.SamplePIPDesignator.&lt;pre class="html" name="code"&gt;&amp;lt;PIPConfig&amp;gt;&lt;br /&gt; &amp;lt;AttributeDesignators&amp;gt;&lt;br /&gt;  &amp;lt;Designator class=&amp;quot;org.wso2.carbon.identity.entitlement.pip.DefaultAttributeFinder&amp;quot; /&amp;gt;&lt;br /&gt;  &amp;lt;Designator class=&amp;quot;org.wso2.carbon.identity.sample.pip.SamplePIPDesignator&amp;quot; /&amp;gt;&lt;br /&gt; &amp;lt;/AttributeDesignators&amp;gt;&lt;br /&gt; &amp;lt;Extensions&amp;gt;&lt;br /&gt;     &amp;lt;Extension class=&amp;quot;org.wso2.carbon.identity.sample.pip.SamplePIPExtension&amp;quot; /&amp;gt;&lt;br /&gt; &amp;lt;/Extensions&amp;gt;&lt;br /&gt;&amp;lt;/PIPConfig&amp;gt;&lt;br /&gt;&lt;/pre&gt;Also, in the above file, make sure that you keep the entry  &amp;lt;Designator class=&amp;quot;org.wso2.carbon.identity.entitlement.pip.DefaultAttributeFinder&amp;quot; /&amp;gt; as it is, because it's the default PIP Designator which will by default talk to the underlying user store.&lt;br /&gt;&lt;br /&gt;Now, let's see how to write PIP Extensions and Designators. You need to have org.wso2.carbon.identity.entitlement-3.2.0.jar and sun-xacml-2.0.1.wso2v1.jar in the classpath. [You can find those jars inside [IS_HOME]\repository\components\plugins&lt;pre class="java" name="code"&gt;package org.wso2.carbon.identity.sample.pip;&lt;br /&gt;&lt;br /&gt;import java.util.HashSet;&lt;br /&gt;import java.util.Set;&lt;br /&gt;&lt;br /&gt;import org.wso2.carbon.identity.entitlement.pip.PIPAttributeFinder;&lt;br /&gt;&lt;br /&gt;public class SamplePIPDesignator implements PIPAttributeFinder {&lt;br /&gt;&lt;br /&gt; @Override&lt;br /&gt; public Set&lt;string&gt; getAttributeValues(String subjectId, String resourceId,&lt;br /&gt;   String attributeId) throws Exception {&lt;br /&gt;  Set&lt;string&gt; attributeValues = new HashSet&lt;string&gt;();&lt;br /&gt;  attributeValues.add("myName");&lt;br /&gt;&lt;br /&gt;  System.out.println("SamplePIPDesignator Called");&lt;br /&gt;  System.out.println("SamplePIPDesignator SubjectId " + subjectId);&lt;br /&gt;  System.out.println("SamplePIPDesignator AttributeId " + attributeId);&lt;br /&gt;  System.out.println("SamplePIPDesignator Resource Id " + resourceId);&lt;br /&gt;&lt;br /&gt;  return attributeValues;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; @Override&lt;br /&gt; public Set&lt;string&gt; getSupportedAttributes() {&lt;br /&gt;  Set&lt;string&gt; attributes = new HashSet&lt;string&gt;();&lt;br /&gt;  attributes.add("http://wso2.org/sample/claims/name");&lt;br /&gt;  return attributes;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;pre class="java" name="code"&gt;package org.wso2.carbon.identity.sample.pip;&lt;br /&gt;&lt;br /&gt;import org.wso2.carbon.identity.entitlement.pip.PIPExtension;&lt;br /&gt;&lt;br /&gt;import com.sun.xacml.ctx.RequestCtx;&lt;br /&gt;&lt;br /&gt;public class SamplePIPExtension implements PIPExtension{&lt;br /&gt;&lt;br /&gt; @Override&lt;br /&gt; public void update(RequestCtx request) {&lt;br /&gt;  System.out.println("SamplePIPExtension Called");&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;Notes :&lt;br /&gt;&lt;br /&gt;1. The latest WSO2 Identity Server is running with the embedded ApacheDS LDAP server. The default port is 10389. If you want to change it, open CARBON_HOME\repository\conf\carbon.xml and look for LDAPServerPort and change it.&lt;br /&gt;&lt;br /&gt;2. When you create or import a XACML policy to the Identity Server - policy will be in Disabled state - you need to Enable it by clicking the Enable link against the policy in the policy list page.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-7383547510692247837?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/7383547510692247837/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=7383547510692247837' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7383547510692247837'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7383547510692247837'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/04/xacml-policy-information-point.html' title='XACML Policy Information Point Extensions &amp; Designators with WSO2 Identity Server 3.2.0'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-VC-FlznySzo/TbA4DmTgRpI/AAAAAAAAAr8/vUDUvJb3ASo/s72-c/Screen%2Bshot%2B2011-04-21%2Bat%2B7.26.35%2BPM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-1590506203437270066</id><published>2011-03-09T22:02:00.002+05:30</published><updated>2011-03-09T22:09:23.624+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Carbon 3.1.0'/><category scheme='http://www.blogger.com/atom/ns#' term='JAX-WS'/><title type='text'>Invoking WSO2 Carbon Admin Services with a JAX-WS Client</title><content type='html'>Any functionality available to you via WSO2 Carbon management console can also be invoked via a web service call.&lt;br /&gt;&lt;br /&gt;In other word all these management related functionalities are exposed via web services.&lt;br /&gt;&lt;br /&gt;To access these web services - also known as admin services, you need to be an authenticated user and also need to have the required set of permissions.&lt;br /&gt;&lt;br /&gt;Following client demonstrates how you can create an authenticated session with WSO2 Carbon and then invoke an admin service with a JAX-WS client.&lt;br /&gt;&lt;pre class="java" name="code"&gt;import java.util.ArrayList;&lt;br /&gt;import java.util.HashMap;&lt;br /&gt;import java.util.List;&lt;br /&gt;import java.util.Map;&lt;br /&gt;&lt;br /&gt;import javax.xml.namespace.QName;&lt;br /&gt;import javax.xml.soap.MessageFactory;&lt;br /&gt;import javax.xml.soap.SOAPBody;&lt;br /&gt;import javax.xml.soap.SOAPConstants;&lt;br /&gt;import javax.xml.soap.SOAPElement;&lt;br /&gt;import javax.xml.soap.SOAPEnvelope;&lt;br /&gt;import javax.xml.soap.SOAPMessage;&lt;br /&gt;import javax.xml.soap.SOAPPart;&lt;br /&gt;import javax.xml.ws.BindingProvider;&lt;br /&gt;import javax.xml.ws.Dispatch;&lt;br /&gt;import javax.xml.ws.Service;&lt;br /&gt;import javax.xml.ws.handler.MessageContext;&lt;br /&gt;import javax.xml.ws.soap.SOAPBinding;&lt;br /&gt;&lt;br /&gt;public class AdminServiceClient {&lt;br /&gt;&lt;br /&gt; private final static String AUTH_ADMIN_EPR = &amp;quot;https://localhost:9443/services/AuthenticationAdmin&amp;quot;;&lt;br /&gt; private final static String USER_ADMIN_EPR = &amp;quot;https://localhost:9443/services/UserAdmin&amp;quot;;&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt;  * @param args&lt;br /&gt;  */&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;&lt;br /&gt;  try {&lt;br /&gt;   QName serviceName = null;&lt;br /&gt;   QName portName = null;&lt;br /&gt;   Service service = null;&lt;br /&gt;   Dispatch&amp;lt;SOAPMessage&amp;gt; dispatch = null;&lt;br /&gt;   BindingProvider provider = null;&lt;br /&gt;   SOAPElement operation = null;&lt;br /&gt;   Map&amp;lt;String, Object&amp;gt; headers = null;&lt;br /&gt;   Map&amp;lt;String, List&amp;lt;String&amp;gt;&amp;gt; reqHeaders = null;&lt;br /&gt;   List&amp;lt;String&amp;gt; cookieList = null;&lt;br /&gt;   SOAPMessage response = null;&lt;br /&gt;   SOAPMessage request = null;&lt;br /&gt;   SOAPPart part = null;&lt;br /&gt;   SOAPEnvelope env = null;&lt;br /&gt;   SOAPBody body = null;&lt;br /&gt;   SOAPElement user = null;&lt;br /&gt;&lt;br /&gt;   serviceName = new QName(&amp;quot;http://mgt.user.carbon.wso2.org&amp;quot;, &amp;quot;UserAdmin&amp;quot;);&lt;br /&gt;   portName = new QName(&amp;quot;http://mgt.user.carbon.wso2.org&amp;quot;, &amp;quot;UserAdminHttpsSoap11Endpoint&amp;quot;);&lt;br /&gt;&lt;br /&gt;   service = Service.create(serviceName);&lt;br /&gt;   service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, USER_ADMIN_EPR);&lt;br /&gt;&lt;br /&gt;   dispatch = service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);&lt;br /&gt;   provider = (BindingProvider) dispatch;&lt;br /&gt;&lt;br /&gt;   MessageFactory mf = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);&lt;br /&gt;&lt;br /&gt;   request = mf.createMessage();&lt;br /&gt;   part = request.getSOAPPart();&lt;br /&gt;   env = part.getEnvelope();&lt;br /&gt;   body = env.getBody();&lt;br /&gt;&lt;br /&gt;   // We are going to get all the roles belong to the user &amp;quot;admin&amp;quot;&lt;br /&gt;   operation = body.addChildElement(&amp;quot;getRolesOfUser&amp;quot;, &amp;quot;ns&amp;quot;,&lt;br /&gt;     &amp;quot;http://mgt.user.carbon.wso2.org&amp;quot;);&lt;br /&gt;&lt;br /&gt;   user = operation.addChildElement(&amp;quot;userName&amp;quot;);&lt;br /&gt;   user.addTextNode(&amp;quot;admin&amp;quot;);&lt;br /&gt;&lt;br /&gt;   request.saveChanges();&lt;br /&gt;&lt;br /&gt;   // We can't just invoke the above method - since it belongs to an admin service. First&lt;br /&gt;   // we need to authenticate with AuthenticationAdmin and get the authenticated cookie.&lt;br /&gt;   // Then we need to add that cookie to the HTTP header of the request.&lt;br /&gt;   headers = provider.getRequestContext();&lt;br /&gt;   reqHeaders = (Map) headers.get(MessageContext.HTTP_REQUEST_HEADERS);&lt;br /&gt;&lt;br /&gt;   if (reqHeaders == null) {&lt;br /&gt;    reqHeaders = new HashMap&amp;lt;String, List&amp;lt;String&amp;gt;&amp;gt;();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   cookieList = new ArrayList&amp;lt;String&amp;gt;();&lt;br /&gt;&lt;br /&gt;   // Let's authenticate as admin/admin and get the cookie.&lt;br /&gt;   cookieList.add(getCookie(&amp;quot;admin&amp;quot;, &amp;quot;admin&amp;quot;));&lt;br /&gt;&lt;br /&gt;   // Need to set this http header as Cookie&lt;br /&gt;   reqHeaders.put(&amp;quot;Cookie&amp;quot;, cookieList);&lt;br /&gt;&lt;br /&gt;   headers.put(MessageContext.HTTP_REQUEST_HEADERS, reqHeaders);&lt;br /&gt;   response = dispatch.invoke(request);&lt;br /&gt;&lt;br /&gt;   System.out.println(response.getSOAPBody().getFirstChild().getTextContent());&lt;br /&gt;&lt;br /&gt;  } catch (Exception e) {&lt;br /&gt;   e.printStackTrace();&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private static String getCookie(String userName, String password) throws Exception {&lt;br /&gt;&lt;br /&gt;  QName serviceName = null;&lt;br /&gt;  QName portName = null;&lt;br /&gt;  Service service = null;&lt;br /&gt;  Dispatch&amp;lt;SOAPMessage&amp;gt; dispatch = null;&lt;br /&gt;  BindingProvider provider = null;&lt;br /&gt;  SOAPElement operation = null;&lt;br /&gt;  SOAPMessage response = null;&lt;br /&gt;  SOAPMessage request = null;&lt;br /&gt;  SOAPPart part = null;&lt;br /&gt;  SOAPEnvelope env = null;&lt;br /&gt;  SOAPBody body = null;&lt;br /&gt;  SOAPElement user = null;&lt;br /&gt;  SOAPElement pwd = null;&lt;br /&gt;&lt;br /&gt;  SOAPElement remoteAddr = null;&lt;br /&gt;&lt;br /&gt;  serviceName = new QName(&amp;quot;http://authentication.services.core.carbon.wso2.org&amp;quot;,&lt;br /&gt;    &amp;quot;AuthenticationAdmin&amp;quot;);&lt;br /&gt;  portName = new QName(&amp;quot;http://authentication.services.core.carbon.wso2.org&amp;quot;,&lt;br /&gt;    &amp;quot;AuthenticationAdminHttpsSoap11Endpoint&amp;quot;);&lt;br /&gt;&lt;br /&gt;  service = Service.create(serviceName);&lt;br /&gt;  service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, AUTH_ADMIN_EPR);&lt;br /&gt;&lt;br /&gt;  dispatch = service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);&lt;br /&gt;&lt;br /&gt;  provider = (BindingProvider) dispatch;&lt;br /&gt;&lt;br /&gt;  MessageFactory mf = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);&lt;br /&gt;&lt;br /&gt;  request = mf.createMessage();&lt;br /&gt;  part = request.getSOAPPart();&lt;br /&gt;&lt;br /&gt;  env = part.getEnvelope();&lt;br /&gt;  body = env.getBody();&lt;br /&gt;&lt;br /&gt;  operation = body.addChildElement(&amp;quot;login&amp;quot;, &amp;quot;ns&amp;quot;,&lt;br /&gt;    &amp;quot;http://authentication.services.core.carbon.wso2.org&amp;quot;);&lt;br /&gt;&lt;br /&gt;  user = operation.addChildElement(&amp;quot;username&amp;quot;);&lt;br /&gt;  user.addTextNode(userName);&lt;br /&gt;&lt;br /&gt;  pwd = operation.addChildElement(&amp;quot;password&amp;quot;);&lt;br /&gt;  pwd.addTextNode(password);&lt;br /&gt;&lt;br /&gt;  remoteAddr = operation.addChildElement(&amp;quot;remoteAddress&amp;quot;);&lt;br /&gt;  remoteAddr.addTextNode(&amp;quot;wso2.org&amp;quot;);&lt;br /&gt;&lt;br /&gt;  request.saveChanges();&lt;br /&gt;&lt;br /&gt;  response = dispatch.invoke(request);&lt;br /&gt;&lt;br /&gt;  if (&amp;quot;true&amp;quot;.equals(response.getSOAPBody().getFirstChild().getTextContent())) {&lt;br /&gt;   List cookieList = null;&lt;br /&gt;   Map respHeaders = null;&lt;br /&gt;   Map&amp;lt;String, Object&amp;gt; headers = null;&lt;br /&gt;&lt;br /&gt;   headers = provider.getResponseContext();&lt;br /&gt;   respHeaders = (Map) headers.get(MessageContext.HTTP_RESPONSE_HEADERS);&lt;br /&gt;   // This is the JSESSIONID cookie.&lt;br /&gt;   cookieList = (List) respHeaders.get(&amp;quot;Set-cookie&amp;quot;);&lt;br /&gt;   return (String) cookieList.get(0);&lt;br /&gt;  } else {&lt;br /&gt;   return null;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-1590506203437270066?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/1590506203437270066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=1590506203437270066' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1590506203437270066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1590506203437270066'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/03/invoking-wso2-carbon-admin-services.html' title='Invoking WSO2 Carbon Admin Services with a JAX-WS Client'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-7616609755682877340</id><published>2011-02-26T13:22:00.026+05:30</published><updated>2011-03-10T16:50:33.883+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><category scheme='http://www.blogger.com/atom/ns#' term='Mac'/><title type='text'>Mac OS X Terminal Tips</title><content type='html'>&lt;img border="0" height="106" width="149" src="http://1.bp.blogspot.com/-f6mhXV3i0nE/TWkE48ROmjI/AAAAAAAAArs/1Zvk5CLS43I/s200/Screen%2Bshot%2B2011-02-26%2Bat%2B7.18.51%2BPM.png" /&gt;&lt;table width="100%"&gt;&lt;tbody&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;1. Go to beginning of the current line&lt;/td&gt;&lt;td align="center"&gt;&lt;br /&gt;Ctrl + A&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;2. Go to the end of the current line&lt;/td&gt;&lt;td align="center"&gt;&lt;br /&gt;Ctrl + E&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;3. Copy the current path&lt;/td&gt;&lt;td align="center"&gt;&lt;br /&gt;$ pwd | pbcopy&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;4. Clear the screen [same as clear]&lt;/td&gt;&lt;td align="center"&gt;&lt;br /&gt;Ctrl + L&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;5. Display all the environment variables&lt;/td&gt;&lt;td align="center"&gt;&lt;br /&gt;$ env&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;6. Deleting from current position to the end of the line&lt;/td&gt;&lt;td align="center"&gt;&lt;br /&gt;Ctrl + K&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;7. Deleting from current position to the beginning of the line&lt;/td&gt;&lt;td align="center"&gt;&lt;br /&gt;Ctrl + U&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;8. Deleting the first word before current position&lt;/td&gt;&lt;td align="center"&gt;&lt;br /&gt;Ctrl + W&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;9. Move the cursor a letter back from the current position&lt;/td&gt;&lt;td align="center"&gt;&lt;br /&gt;Ctrl + B&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;10. Move the cursor a letter forward from the current position&lt;/td&gt;&lt;td align="center"&gt;&lt;br /&gt;Ctrl + F&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;11. Open current location in Finder window&lt;/td&gt;&lt;td align="center"&gt;&lt;br /&gt;$ open .&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;12. Open a file with unknown extension with the default editor&lt;/td&gt;&lt;td align="center"&gt;&lt;br /&gt;$ open -t file.ext&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;13. Watch a particular file to see who's opening it&lt;/td&gt;&lt;td align="center"&gt;&lt;br /&gt;sudo opensnoop -f PathToTheFile&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;br /&gt;14. Text-to-speech&lt;/td&gt;&lt;td align="center"&gt;&lt;br /&gt;say "HI"&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;15. Runs the last command again&lt;/td&gt;&lt;td align="center"&gt;!!&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan"2"&gt;&lt;br /&gt;16. Hold option and click a position in the current line to move your cursor to that position.&lt;/td&gt;&lt;/tr&gt;&lt;tr bgcolor="#800000"&gt;&lt;td&gt;&lt;br /&gt;17. List all possible commands&lt;/td&gt;&lt;td align="center"&gt;Hit and hold ESC&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-7616609755682877340?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/7616609755682877340/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=7616609755682877340' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7616609755682877340'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7616609755682877340'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/02/mac-os-x-command-line-tips.html' title='Mac OS X Terminal Tips'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-f6mhXV3i0nE/TWkE48ROmjI/AAAAAAAAArs/1Zvk5CLS43I/s72-c/Screen%2Bshot%2B2011-02-26%2Bat%2B7.18.51%2BPM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-6579307614380658589</id><published>2011-02-20T09:34:00.004+05:30</published><updated>2011-02-20T09:38:22.740+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Facebook'/><title type='text'>Enabling secured browsing with Facebook</title><content type='html'>Did you know there is an option in Facebook to enable secured browsing..?&lt;br /&gt;&lt;br /&gt;Go to Account --&gt; Account Settings --&gt; Account Security and enable HTTPS browsing for your account as shown below.&lt;br /&gt;&lt;br /&gt;&lt;img border="0" height="147" width="400" src="http://1.bp.blogspot.com/-WL0vjSUwQX0/TWCR8H-WesI/AAAAAAAAArc/YbrlXvVjyhg/s400/Screen%2Bshot%2B2011-02-20%2Bat%2B9.27.12%2BAM.png" /&gt;&lt;br /&gt;&lt;br /&gt;I am bit surprised though why this isn't enabled by default.&lt;br /&gt;&lt;br /&gt;There were many incidents reported where the Facebook sessions were &lt;a href="http://www.pcworld.com/article/209333/how_to_hijack_facebook_using_firesheep.html"&gt;hijacked&lt;/a&gt; - using Firesheep - a Firefox add-on.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-6579307614380658589?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/6579307614380658589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=6579307614380658589' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6579307614380658589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6579307614380658589'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/02/enable-secure-browsing-with-facebook.html' title='Enabling secured browsing with Facebook'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-WL0vjSUwQX0/TWCR8H-WesI/AAAAAAAAArc/YbrlXvVjyhg/s72-c/Screen%2Bshot%2B2011-02-20%2Bat%2B9.27.12%2BAM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-6706126256683974234</id><published>2011-02-16T07:48:00.010+05:30</published><updated>2011-02-17T00:18:32.155+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='GPG'/><title type='text'>11 GPG Commands One Should NEVER Forget</title><content type='html'>&lt;a href="http://www.gnupg.org/"&gt;GnuPG&lt;/a&gt; is the GNU project's complete and free implementation of the OpenPGP standard as defined by RFC4880 . GnuPG allows to encrypt and sign your data and communication, features a versatile key management system as well as access modules for all kinds of public key directories.&lt;br /&gt;&lt;br /&gt;1. Create GPG Keys&lt;pre class="html" name="code"&gt;$ gpg --gen-key&lt;/pre&gt;2. List the available keys in your keyring&lt;pre class="html" name="code"&gt;$ gpg --list-keys&lt;/pre&gt;3. Exporting the public key - by user id&lt;pre class="html" name="code"&gt;$ gpg --armor --export &amp;lt;uid&gt;&lt;br /&gt;&lt;br /&gt;Example :&lt;br /&gt;$ gpg --armor --export prabath@wso2.com&lt;/pre&gt;4. Importing a public key of a trusted user to your keyring&lt;pre class="html" name="code"&gt;$ gpg --import wso2.gpg&lt;/pre&gt;5. Encrypting a document - you need to import the public key corresponding to the uid-of-recipient first in to your keyring as per step - 4.&lt;pre class="html" name="code"&gt;$ gpg --output &amp;lt;output-file&gt;  --encrypt --recipient &amp;lt;uid-of-recipient&gt;  &amp;lt;input-file&gt;&lt;br /&gt;&lt;br /&gt;Example :&lt;br /&gt;$ gpg --output test.txt.gpg  --encrypt --recipient prabath@wso2.com  test.txt&lt;/pre&gt;6. Decrypting&lt;pre class="html" name="code"&gt;$ gpg --output &amp;lt;output-file&gt; --decrypt &amp;lt;input-file&gt;&lt;br /&gt;&lt;br /&gt;Example :&lt;br /&gt;$ gpg --output text.txt --decrypt test.txt.gpg&lt;/pre&gt;7. Signing a document [detached signature]&lt;pre class="html" name="code"&gt;$ gpg --armor --output &amp;lt;signature&gt; --detach-sig &amp;lt;file-to-sign&gt;&lt;/pre&gt;8. Verifying a signature [detached signature] - you need to have the public key of the person who signed it in your keyring - see step-4.&lt;pre class="html" name="code"&gt;$ gpg --verify &amp;lt;signature&gt; &amp;lt;original-file&gt;&lt;/pre&gt;9. Exporting private keys&lt;pre class="html" name="code"&gt;$ gpg --armor --output &amp;lt;key-file-name&gt; --export-secret-keys &amp;lt;uid&gt;&lt;br /&gt;&lt;br /&gt;Example : &lt;br /&gt;$ gpg --armor --output prabath.asc --export-secret-keys prabath@wso2.com&lt;/pre&gt;10. Uploading your public key to a key server.&lt;pre class="html" name="code"&gt;$ gpg --keyserver certserver.pgp.com --send-key &amp;lt;uid&gt;&lt;/pre&gt;11. Download a key from a key server.&lt;pre class="html" name="code"&gt;$ gpg --keyserver certserver.pgp.com --recv-key &amp;lt;key_id&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-6706126256683974234?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/6706126256683974234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=6706126256683974234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6706126256683974234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6706126256683974234'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/02/11-gpg-commands-one-should-never-forget.html' title='11 GPG Commands One Should NEVER Forget'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-8203991052834077292</id><published>2011-02-14T18:11:00.002+05:30</published><updated>2011-02-14T18:21:09.831+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSO2'/><category scheme='http://www.blogger.com/atom/ns#' term='Synapse'/><category scheme='http://www.blogger.com/atom/ns#' term='ESB'/><title type='text'>WSO2 ESB Property Mediator - Different Scopes</title><content type='html'>Properties are name value pairs. Properties are a way to convey information across different processing units. For example user may need to set a transport property from the message mediation. Or user may need to remove a property which is set by the transport. This mediator sets or removes properties for a particular message.&lt;br /&gt;&lt;br /&gt;Property mediator has no direct impact on the message but rather on the message context flowing through Synapse. The properties set on a message can be later retrieved through the synapse:get-property(prop-name) XPath extension function. If a scope is specified for a property, the property could be set as a transport header property or an (underlying) Axis2 message context property, or as a Axis2 client option. If a scope is not specified, it will default to the Synapse message context scope. Using the property element with action specified as "remove" you can remove any existing message context properties.&lt;br /&gt;&lt;br /&gt;The above extracted from the WSO2 ESB &lt;a href="http://wso2.org/project/esb/java/3.0.1/docs/mediators/property.html"&gt;documentation&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;This blog post focuses on different types of scopes available while setting properties.&lt;br /&gt;&lt;br /&gt;1. &lt;b&gt;Default - or the Synapse&lt;/b&gt;&lt;br /&gt;Once you set a property under this scope - the value of it will be available through out both the in/out sequences.&lt;br /&gt;&lt;br /&gt;To access this property inside the mediate() method of a mediator...&lt;pre class="java" name="code"&gt;public boolean mediate(org.apache.synapse.MessageContext mc) {&lt;br /&gt;// Available in both in-sequence and out-sequenc&lt;br /&gt;String propValue = (String) mc.getProperty("PropName");&lt;br /&gt;System.out.println("SCOPE_SYNAPSE : " + propValue);&lt;br /&gt;return true;&lt;br /&gt;}&lt;/pre&gt;2. &lt;b&gt;Axis2&lt;/b&gt;&lt;br /&gt;Once you set a property under this scope - the value of it will be available only through out the the sequence it's been set. If you set the Property mediator to the in-sequence, you cannot access it in the out-sequence.To access this property inside the mediate() method of a mediator...&lt;pre class="java" name="code"&gt;public boolean mediate(org.apache.synapse.MessageContext mc) {&lt;br /&gt;org.apache.axis2.context.MessageContext axis2MsgContext;&lt;br /&gt;axis2MsgContext = ((Axis2MessageContext) mc).getAxis2MessageContext();&lt;br /&gt;&lt;br /&gt;// Available only in the sequence the property is defined.&lt;br /&gt;String propValue = (String) axis2MsgContext.getProperty("PropName");&lt;br /&gt;System.out.println("SCOPE_AXIS2 : " + propValue);&lt;br /&gt;return true;&lt;br /&gt;}&lt;/pre&gt;3. &lt;b&gt;Axis2-Client&lt;/b&gt;&lt;br /&gt;This is similar to Synapse scope. The difference is - you can access it in following two ways..&lt;pre class="java" name="code"&gt;public boolean mediate(org.apache.synapse.MessageContext mc) {&lt;br /&gt;org.apache.axis2.context.MessageContext axis2MsgContext;&lt;br /&gt;axis2MsgContext = ((Axis2MessageContext) mc).getAxis2MessageContext();&lt;br /&gt;String propValue = (String) axis2MsgContext.getProperty("PropName");&lt;br /&gt;System.out.println("SCOPE_AXIS2_CLIENT - 1 : " + propValue);&lt;br /&gt;&lt;br /&gt;propValue = (String) axis2MsgContext.getOptions().getProperty("PropName");&lt;br /&gt;System.out.println("SCOPE_AXIS2_CLIENT - 2: " + propValue);&lt;br /&gt;return true;&lt;br /&gt;}&lt;/pre&gt;4. &lt;b&gt;Transport&lt;/b&gt;&lt;br /&gt;Once you set a property under this scope - it will be added to the transport header of the out going message from the ESB.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-8203991052834077292?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/8203991052834077292/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=8203991052834077292' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8203991052834077292'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8203991052834077292'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/02/wso2-esb-property-mediator-different.html' title='WSO2 ESB Property Mediator - Different Scopes'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-1729313519703248178</id><published>2011-02-14T00:26:00.002+05:30</published><updated>2011-02-14T00:33:53.263+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='WS-Security'/><title type='text'>Invoking A Secured Web Service With soapUI</title><content type='html'>&lt;a href="http://blog.thilinamb.com/"&gt;Thilina&lt;/a&gt; has written a very nice guide on the $subject Available &lt;a href="http://blog.thilinamb.com/2011/02/invoking-secured-web-service-with.html"&gt;here&lt;/a&gt;...&lt;br /&gt;&lt;img border="0" height="284" width="400" src="http://4.bp.blogspot.com/--g4vPnv_AJw/TVgrAeq85cI/AAAAAAAAArU/1MvV1gQ-4Vo/s400/Screen%2Bshot%2B2011-02-14%2Bat%2B12.32.02%2BAM.png" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-1729313519703248178?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/1729313519703248178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=1729313519703248178' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1729313519703248178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1729313519703248178'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/02/invoking-secured-web-service-with.html' title='Invoking A Secured Web Service With soapUI'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/--g4vPnv_AJw/TVgrAeq85cI/AAAAAAAAArU/1MvV1gQ-4Vo/s72-c/Screen%2Bshot%2B2011-02-14%2Bat%2B12.32.02%2BAM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-8409444599503454662</id><published>2011-02-13T23:28:00.001+05:30</published><updated>2011-02-13T23:30:32.092+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSO2'/><category scheme='http://www.blogger.com/atom/ns#' term='Synapse'/><category scheme='http://www.blogger.com/atom/ns#' term='ESB'/><title type='text'>Accessing the HTTP method within a WSO2 ESB Mediator</title><content type='html'>I couldn't find this in the ESB &lt;a href="http://wso2.org/project/esb/java/3.0.1/docs/properties_guide.html"&gt;property&lt;/a&gt; documentation - so thought of keeping a note here.&lt;br /&gt;&lt;br /&gt;Also - there is a chance that you can confuse the constant "HTTP_METHOD" with org.apache.axis2.transport.http.HTTPConstants.HTTP_METHOD - which internally refers to ""HTTP_METHOD_OBJECT""&lt;pre class="java" name="code"&gt;public boolean mediate(org.apache.synapse.MessageContext synCtx) {&lt;br /&gt;org.apache.synapse.core.axis2.Axis2MessageContext.Axis2MessageContext axis2Msgcontext = null;&lt;br /&gt;org.apache.axis2.context.MessageContext msgContext  = null;&lt;br /&gt;axis2Msgcontext = (Axis2MessageContext) synCtx;&lt;br /&gt;msgContext = axis2Msgcontext.getAxis2MessageContext();&lt;br /&gt;String httpMethod = (String) msgContext.getProperty("HTTP_METHOD");&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-8409444599503454662?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/8409444599503454662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=8409444599503454662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8409444599503454662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8409444599503454662'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/02/accessing-http-method-within-wso2-esb.html' title='Accessing the HTTP method within a WSO2 ESB Mediator'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-2509372461034511302</id><published>2011-02-12T10:05:00.047+05:30</published><updated>2011-02-26T08:15:27.423+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='RPC'/><category scheme='http://www.blogger.com/atom/ns#' term='JRPC'/><title type='text'>RPC with Java</title><content type='html'>The goal of RPC in general is make distributed programming as easy as possible by creating the illusion that an exchange of data over the network that results in some processing (on another machine than the one the application is running on) is nothing more than a special kind of procedure call — one that has the special attribute of being “remote”.&lt;br /&gt;&lt;br /&gt;Stating the obvious, there is a clear separation of roles in this scenario: the application invoking the procedure (the caller) is called the client, the one executing the procedure is the server. (In more advanced applications, a single program may assume both roles during the course of its execution.)&lt;br /&gt;&lt;br /&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-o5148Y0iqwM/TVYZC8Lhn3I/AAAAAAAAArM/c0km4gwouaA/s1600/Screen%2Bshot%2B2011-02-12%2Bat%2B10.51.16%2BAM.png" /&gt;&lt;br /&gt;&lt;br /&gt;Unsurprisingly, RPC is the foundation of client/server computing. While RPC started out as a way to provide a transparent programming experience for traditional, procedural models, it was quickly followed by technologies that aimed to do the same for object-oriented programming. Examples include DCOM, CORBA, and RMI.&lt;br /&gt;&lt;br /&gt;The first popular RPC solution was introduced by Sun (Sun RPC, later called ONC RPC) together with NFS, the Network File System. It featured all the important parts of more modern incarnations: An interface description with an associated stub/skeleton generator, marshaling, even a (albeit very simple) registry (portmap).&lt;br /&gt;&lt;br /&gt;The other important RPC standard is DCE RPC, which is also used as the foundation of Microsoft’s DCOM.&lt;br /&gt;&lt;br /&gt;The Sun RPC compiler is called &lt;b&gt;rpcgen&lt;/b&gt;. As input, it takes a list of remote procedures (interfaces) defined in an interface definition language (IDL).&lt;br /&gt;&lt;br /&gt;&lt;u&gt;The output from rpcgen is a set of files that include...&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;1. Server code: Main function that sets up a socket, registers the port with a name server, listens for and accepts connections, receives messages, unmarshals parameters, calls the user-written server function, marshals the return value, and sends back a network message.&lt;br /&gt;&lt;br /&gt;2. Client stub: The code with the interface of the remote function that marshals parameters, sends the message to the server, and unmarshals the return value.&lt;br /&gt;&lt;br /&gt;3. Header: Contains definitions of symbols used by client and server as well as function prototypes&lt;br /&gt;&lt;br /&gt;4. Data conversion functions: A separate file may be generated if special functions need to be called to convert between local data types and their marshaled forms.&lt;br /&gt;&lt;br /&gt;The rpcgen tool generates code in C - from a given IDL.&lt;br /&gt;&lt;br /&gt;Netbula JRPC is a complete port of the C version of ONC RPC to the Java(tm) platform - which generates code in JAVA. In this blog post we'll be using Netbula JRPC.&lt;br /&gt;&lt;br /&gt;Also &lt;a href="http://www.onc-rpc-xdr.com/products/rpc/rpc-java-xml.asp"&gt;Distinct ONC RPC/XDR&lt;/a&gt; for Java - is another vendor who provides an ONC RPC toolkit in java.&lt;br /&gt;&lt;br /&gt;Let's first have a look at how a sample IDL file looks like.&lt;br /&gt;&lt;pre class="java" name="code"&gt;type definitions&lt;br /&gt;&lt;br /&gt;program identifier { &lt;br /&gt;   version version_id {&lt;br /&gt;       procedure list&lt;br /&gt;    } = value;&lt;br /&gt;} = value;&lt;/pre&gt;&lt;b&gt;type definitions&lt;/b&gt; block is used to define &lt;b&gt;structs&lt;/b&gt; - for example,&lt;br /&gt;&lt;pre class="java" name="code"&gt;struct person {&lt;br /&gt;string name&amp;lt;&amp;gt;;&lt;br /&gt;int age;&lt;br /&gt;};&lt;/pre&gt;Then the &lt;b&gt;program&lt;/b&gt; block - a given &lt;b&gt;program&lt;/b&gt; block can have different versions of the same interface - and &lt;b&gt;program&lt;/b&gt; has a program number to identify it uniquely. In the following example, the program number is 1234567.&lt;br /&gt;&lt;pre class="java" name="code"&gt;program msgserv {&lt;br /&gt;    .................&lt;br /&gt;} = 1234567;&lt;/pre&gt;Now let's have a look at the &lt;b&gt;version&lt;/b&gt; block. As I mentioned before there can be multiple &lt;b&gt;version&lt;/b&gt; blocks inside a given &lt;b&gt;program&lt;/b&gt; and each version is identified by the version number. In the following example - the version number is - 1.&lt;br /&gt;&lt;pre class="java" name="code"&gt;program msgserv {&lt;br /&gt;    version MSGSERV_V1 {&lt;br /&gt;     .................... &lt;br /&gt;     }= 1;&lt;br /&gt;} = 1234567;&lt;/pre&gt;Next the procedure list. Inside a one version - there can be set of procedures defined. And there also each procedure is identified with a unique number. In the following example sendmsg() is identified by number - 2 and addperson() is identified by number - 3.&lt;br /&gt;&lt;pre class="java" name="code"&gt;program msgserv {&lt;br /&gt;    version MSGSERV_V1 {&lt;br /&gt;                string sendmsg(string)=2; &lt;br /&gt;                void addperson(person)=3;     &lt;br /&gt;    }= 1;&lt;br /&gt;} = 1234567;&lt;/pre&gt;&lt;u&gt;RPC Call Message&lt;/u&gt;&lt;br /&gt;Each remote procedure call message contains the following unsigned integer fields to uniquely identify the remote procedure.&lt;br /&gt;- Program number&lt;br /&gt;- Program version number&lt;br /&gt;- Procedure number&lt;br /&gt;&lt;br /&gt;&lt;u&gt;RPC Reply Message&lt;/u&gt;&lt;br /&gt;The RPC protocol for a reply message varies depending on whether the call message is accepted or rejected by the network server. The reply message to a request contains information to distinguish the following conditions.&lt;br /&gt;- RPC executed the call message successfully.&lt;br /&gt;- The remote implementation of RPC is not protocol version 2. The lowest and highest supported RPC version numbers are returned.&lt;br /&gt;- The remote program is not available on the remote system.&lt;br /&gt;- The remote program does not support the requested version number. The lowest and highest supported remote program version numbers are returned.&lt;br /&gt;- The requested procedure number does not exist. This is usually a caller-side protocol or programming error.&lt;br /&gt;&lt;br /&gt;Let's get our hands dirty.. Following is the complete IDL of our example used here - which is in the file &lt;b&gt;msg.x&lt;/b&gt;.&lt;br /&gt;&lt;pre class="java" name="code"&gt;struct person {&lt;br /&gt;string name&amp;lt;&amp;gt;;&lt;br /&gt;int age;&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;program msgserv {&lt;br /&gt;    version MSGSERV_V1 {&lt;br /&gt;      string sendmsg(string)=2; &lt;br /&gt;      void addperson(person)=3; &lt;br /&gt;     }= 1;&lt;br /&gt;} = 1234567;&lt;br /&gt;&lt;/pre&gt;Now, you need to download Netbula JRPC from &lt;a href="http://netbula.com/download/javarpc_dl.html"&gt;here&lt;/a&gt;. You can find the jrpcgen tool inside the bin folder.&lt;br /&gt;&lt;br /&gt;Let's use jrpcgen to generate Java code.&lt;br /&gt;&lt;pre class="java" name="code"&gt;$ jrpcgen msg.x&lt;br /&gt;&lt;/pre&gt;This generates four files.&lt;br /&gt;&lt;br /&gt;1. msgserv.java : The RPC program interface definition, including constant definition such as program number.&lt;br /&gt;&lt;br /&gt;2. msgserv_cln.java : The client stub class. This class implements the RPC interface defined above. An RPC client program instantiate an instance of this class and call its methods (remote call).&lt;br /&gt;&lt;br /&gt;3. msgserv_svcb.java : The RPC service. This class inherits the RPC interface and is abstract, the programmer needs to extend this class and supply the implmentation for the interface.&lt;br /&gt;&lt;br /&gt;4. person.java : The corresponding Java file for the struct person.&lt;br /&gt;&lt;br /&gt;Compile all four java files - make sure you have orpc.jar in the classpath. You can find orpc.jar inside the lib directory of Netbula distribution you downloaded.&lt;br /&gt;&lt;pre class="java" name="code"&gt;$ javac msgserv.java person.java msgserv_cln.java msgserv_svcb.java -classpath orpc.dev\lib\orpc.jar&lt;/pre&gt;Next let's write the actual service and start it. Following is the code for it - msgsvc.java.&lt;br /&gt;&lt;pre class="java" name="code"&gt;import netbula.ORPC.*;&lt;br /&gt;&lt;br /&gt;public class msgsvc extends msgserv_svcb {&lt;br /&gt;        &lt;br /&gt;//implement the server function, &lt;br /&gt;//let's just echo the msg back&lt;br /&gt;public String sendmsg(String msg) {&lt;br /&gt; System.out.println("got msg from client "+ msg);&lt;br /&gt; return msg;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void addperson(person psn) {&lt;br /&gt; System.out.println("got msg from client");&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//main function runs the server&lt;br /&gt;public static void main(String srgv[]) {&lt;br /&gt;&lt;br /&gt;//let's run the server using the run() method in Svc&lt;br /&gt;//For more flexibility, one could use the TCPServer and UDPServer directly&lt;br /&gt;&lt;br /&gt;   new Thread(new PortMapper()).start();&lt;br /&gt;&lt;br /&gt;   try {  &lt;br /&gt;     new msgsvc().run(); &lt;br /&gt;   } catch(netbula.ORPC.rpc_err ex){&lt;br /&gt;      System.out.println("error occured");&lt;br /&gt;   }&lt;br /&gt;  &lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;class PortMapper implements Runnable {&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public void run() {&lt;br /&gt;&lt;br /&gt; try {&lt;br /&gt;   new Pmapsvc().run();&lt;br /&gt; } catch (rpc_err e1) {&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;}&lt;/pre&gt;Now compile and start the server - msgsvc.java.&lt;br /&gt;&lt;pre class="java" name="code"&gt;$ javac msgsvc.java -classpath .;orpc.dev\lib\orpc.jar&lt;br /&gt;$ java msgsvc  -classpath .;orpc.dev\lib\orpc.jar&lt;/pre&gt;Next the client... Following is the code for client.&lt;br /&gt;&lt;pre class="java" name="code"&gt;import netbula.ORPC.*;&lt;br /&gt;               &lt;br /&gt;import java.net.*;&lt;br /&gt; &lt;br /&gt;public class ClientTest {  &lt;br /&gt;    &lt;br /&gt;public ClientTest () {}&lt;br /&gt;                              &lt;br /&gt;static public void main(String args[]) {&lt;br /&gt;               &lt;br /&gt;try {&lt;br /&gt;               &lt;br /&gt;     msgserv_cln cl = new msgserv_cln(args[0], "udp");            &lt;br /&gt;     String msg = "hello world\n";&lt;br /&gt;               &lt;br /&gt;     System.out.println("sending.. ");&lt;br /&gt;               &lt;br /&gt;     for(int i=0; i&amp;lt;5; i++){&lt;br /&gt;           String reply = cl.sendmsg(msg);&lt;br /&gt;           System.out.println("got " + reply +"\n");&lt;br /&gt;     }&lt;br /&gt;}catch (rpc_err e) {&lt;br /&gt;     System.out.println("rpc: " + e.toString());&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/pre&gt;Here, we constructed the client which connects to the server on host args[0] with UDP protocol, send a message, and print out the reply.&lt;br /&gt;&lt;pre class="java" name="code"&gt;$ javac ClientTest.java -classpath .;orpc.dev\lib\orpc.jar&lt;br /&gt;$ java ClientTest localhost  -classpath .;orpc.dev\lib\orpc.jar&lt;/pre&gt;If you get here - means your sample works fine.. :-) Let's get in to the internals.&lt;br /&gt;&lt;br /&gt;You may recall - that I mentioned jrpcgen produces four java classes. One of them is the interface, msgserv.java - which is been implemented by both the client and server side stubs.&lt;br /&gt;&lt;br /&gt;Let's have a look at this interface.&lt;br /&gt;&lt;pre class="java" name="code"&gt;public interface msgserv{&lt;br /&gt;&lt;br /&gt; public static final int _def_pno = 1234567;&lt;br /&gt; public static final int _def_vno = 1;&lt;br /&gt;&lt;br /&gt; public static final int _sendmsg_proc = 2;&lt;br /&gt; public static final int _addperson_proc = 3;&lt;br /&gt; &lt;br /&gt; public String sendmsg(String in_arg) throws netbula.ORPC.rpc_err;&lt;br /&gt; public void addperson(person in_arg) throws netbula.ORPC.rpc_err;&lt;br /&gt;}&lt;/pre&gt;Can you notice that this defined four constants. _def_pno is the program number. _def_vno version number of the interface. Other two are the numbers corresponding to each procedure defined in the IDL.&lt;br /&gt;&lt;br /&gt;Now let's have a look at the constructor of the client side stub, instantiated by our ClientTest.java above.&lt;br /&gt;&lt;pre class="java" name="code"&gt;/**&lt;br /&gt;Construct an RPC client object connected to a server&lt;br /&gt;on the specified host with the specified protocol&lt;br /&gt;&lt;br /&gt;@param host server hostname, or URL of the RPC proxy if http is used&lt;br /&gt;@param proto protocol, can be "tcp", "udp" or "http"&lt;br /&gt;*/&lt;br /&gt;public msgserv_cln(String host, String proto) throws rpc_err {&lt;br /&gt; super(host, msgserv._def_pno, msgserv._def_vno, proto);&lt;br /&gt;}&lt;/pre&gt;See here in this constructor it passes the program number[_def_pno] and the version number[_def_vno] to construct the instance. So - this particular instance is created for a given version of the given program.&lt;br /&gt;&lt;br /&gt;Now you got a very valid question. What if we have multiple versions inside the same program. How does this constructor look like. Well.. in case we have multiple versions - then for each version separate client/server stubs as well as an interface will be generated.&lt;br /&gt;&lt;br /&gt;Similarly if you look at the sendmessage() method of client side stub, you will find out - the procedure number is used to invoke the method.&lt;br /&gt;&lt;br /&gt;The above emphasizes on the value of having program number, version number and procedure numbers in RPC. Still not happy? Then let's have a look at the server side stub.&lt;br /&gt;&lt;pre class="java" name="code"&gt;public XDT proc_call (int proc, XDR inXDR) throws XDRError {&lt;br /&gt;  switch(proc) {&lt;br /&gt; case 0:  return new XDTvoid();&lt;br /&gt;&lt;br /&gt; case 2:&lt;br /&gt;         String _out_arg2;&lt;br /&gt;  try {&lt;br /&gt;   XDTString _in_arg = new XDTString();&lt;br /&gt;   _in_arg.xdr(inXDR);&lt;br /&gt;   _out_arg2 = this.sendmsg(_in_arg.value);&lt;br /&gt;  } catch (XDRError e) {&lt;br /&gt;   throw e;&lt;br /&gt;  }&lt;br /&gt;  return new XDTString(_out_arg2);&lt;br /&gt;&lt;br /&gt; case 3:&lt;br /&gt;  try {&lt;br /&gt;   person _in_arg = new person();&lt;br /&gt;   _in_arg.xdr(inXDR);&lt;br /&gt;   this.addperson(_in_arg);&lt;br /&gt;  } catch (XDRError e) {&lt;br /&gt;   throw e;&lt;br /&gt;  }&lt;br /&gt;  return new XDTvoid();&lt;br /&gt;&lt;br /&gt;  default: return null;&lt;br /&gt;  }&lt;br /&gt; }&lt;/pre&gt;Here, this the method invoked at the server side when a service method been invoked from the client end.&lt;br /&gt;&lt;br /&gt;Here you will see - based on the procedure number, procedure been invoked.&lt;br /&gt;&lt;br /&gt;References : &lt;br /&gt;&lt;br /&gt;[1]: http://www.innoq.com/blog/st/2005/05/18/rpcstyle_web_services.html&lt;br /&gt;[2]: http://netbula.com/javarpc/msgsamp.html&lt;br /&gt;[3]: http://www.javvin.com/protocol/rfc1831.pdf : RPC: Remote Procedure Call Protocol Specification Version 2 (ONC version)&lt;br /&gt;[4]: http://www.javvin.com/protocol/rfc1057.pdf : RPC: Remote Procedure Call Protocol Specification Version 2 (Sun version)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-2509372461034511302?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/2509372461034511302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=2509372461034511302' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2509372461034511302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2509372461034511302'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/02/rpc-with-java.html' title='RPC with Java'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-o5148Y0iqwM/TVYZC8Lhn3I/AAAAAAAAArM/c0km4gwouaA/s72-c/Screen%2Bshot%2B2011-02-12%2Bat%2B10.51.16%2BAM.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-3774181016476329881</id><published>2011-02-10T11:50:00.004+05:30</published><updated>2011-02-10T11:55:07.939+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Axis2'/><category scheme='http://www.blogger.com/atom/ns#' term='Axis2 1.5'/><title type='text'>Adding custom HTTP headers via Axis2 Client</title><content type='html'>This post explains how to add custom HTTP headers to a web service request initiated from an Axis2 client.&lt;br /&gt;&lt;br /&gt;You may also have a look at &lt;a href="http://www.keith-chapman.org/2008/10/axis2-setting-custom-http-headers-on.html"&gt;this&lt;/a&gt; blog post by Keith, which explains how to add custom HTTP header to a response message from Axis2 service end.&lt;pre name="code" class="java"&gt;// Create an instance of org.apache.axis2.client.ServiceClient&lt;br /&gt;ServiceClient client = ...&lt;br /&gt;&lt;br /&gt;// Create an instance of org.apache.axis2.client.Options&lt;br /&gt;Options options = new Options();&lt;br /&gt;&lt;br /&gt;List list = new ArrayList();&lt;br /&gt;&lt;br /&gt;// Create an instance of org.apache.commons.httpclient.Header&lt;br /&gt;Header header = new Header();&lt;br /&gt;&lt;br /&gt;// Http header. Name : user, Value : admin&lt;br /&gt;header.setName("user");&lt;br /&gt;header.setValue("admin");&lt;br /&gt;  &lt;br /&gt;list.add(header);&lt;br /&gt;options.setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_HEADERS, list);&lt;br /&gt;&lt;br /&gt;client.setOptions(options);&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-3774181016476329881?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/3774181016476329881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=3774181016476329881' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3774181016476329881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3774181016476329881'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/02/adding-custom-http-headers-via-axis2.html' title='Adding custom HTTP headers via Axis2 Client'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-5162063731635159462</id><published>2011-02-05T13:48:00.001+05:30</published><updated>2011-02-05T13:48:45.952+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><title type='text'>Securing RESTful Services</title><content type='html'>&lt;div style="width:425px" id="__ss_6820225"&gt;&lt;object id="__sse6820225" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=webinar-110205021052-phpapp02&amp;stripped_title=securing-restful-services&amp;userName=prabathsiriwardena" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed name="__sse6820225" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=webinar-110205021052-phpapp02&amp;stripped_title=securing-restful-services&amp;userName=prabathsiriwardena" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;Video recording available &lt;a href="http://wso2.org/premium/webinars/securing-restful-services"&gt;here&lt;/a&gt;...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-5162063731635159462?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/5162063731635159462/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=5162063731635159462' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5162063731635159462'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5162063731635159462'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/02/securing-restfull-services.html' title='Securing RESTful Services'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-345933757366810694</id><published>2011-02-05T11:54:00.008+05:30</published><updated>2011-02-05T12:44:17.335+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Carbon 3.1.0'/><category scheme='http://www.blogger.com/atom/ns#' term='WSO2'/><category scheme='http://www.blogger.com/atom/ns#' term='Carbon 3.0.x'/><category scheme='http://www.blogger.com/atom/ns#' term='ESB'/><title type='text'>[WSO2 ESB] Invoking a Web Service via HTTPS from a Proxy Service</title><content type='html'>1. Get the public certificate of the Web Service deployed over HTTPS&lt;br /&gt;&lt;br /&gt;2. Import the certificate from [1] to [ESB_HOM]/resources/security/client_truststore.jks&lt;br /&gt;&lt;br /&gt;&lt;b&gt;:\&amp;gt;keytool import public_cert.crt -alias myservice -keystore client_truststore.jks&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The default password is wso2carbon. You can put any name to alias [e.g. myservice] and need to replace public_cert.crt with name of the certificate you have from [1].&lt;br /&gt;&lt;br /&gt;3.You may be using an IP address as the web service end point or the CN of the certificate issued for the end point may not match its server url. This could cause a host name verification error.&lt;br /&gt;&lt;br /&gt;To overcome that, find the following in [ESB_HOME]/repository/conf/axis2.xml ..&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;parameter name="HostnameVerifier"&amp;gt;DefaultAndLocalhost&amp;lt;/parameter&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;uncomment it and change it to the following...&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&amp;lt;parameter name="HostnameVerifier"&amp;gt;AllowAll&amp;lt;/parameter&amp;gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;4. If the Web Service or it's WSLD - or the both enabled for mutual authentication - you need export the public certificate of WSO2 ESB out and import it to the trust store of the Web Service.&lt;br /&gt;&lt;br /&gt;To export out the ESB public certificate you can use the following.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;:\&amp;gt;keytool export -file esb_public_cert.crt -alias wso2carbon -keystore wso2carbon.jks&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;You can find wso2carbon.jks at [ESB_HOM]/resources/security/wso2carbon.jks and it default password is wso2carbon.&lt;br /&gt;&lt;br /&gt;That's it..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-345933757366810694?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/345933757366810694/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=345933757366810694' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/345933757366810694'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/345933757366810694'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/02/wso2-esb-invoking-web-service-via-https.html' title='[WSO2 ESB] Invoking a Web Service via HTTPS from a Proxy Service'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-3956785598333717249</id><published>2011-02-05T01:12:00.002+05:30</published><updated>2011-02-05T01:12:21.905+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Java'/><title type='text'>Java Class Loading</title><content type='html'>Class loading is widely viewed as one of the darkest arts in Java development. In this session, Jason Greene will provide insight into the how and why of Java SE, Java EE, JBoss Application Server, JBoss Microcontainer, and OSGi class loading. He will offer historical perspective by beginning with JDK internals and progress to the modern, modular class loader models in use today. In addition, Jason will cover common pitfalls and methodologies to avoid them.&lt;br /&gt;&lt;br /&gt;&lt;iframe src="http://player.vimeo.com/video/15122570" width="400" height="300" frameborder="0"&gt;&lt;/iframe&gt;&lt;p&gt;&lt;a href="http://vimeo.com/15122570"&gt;The Zen of Class Loading&lt;/a&gt; from &lt;a href="http://vimeo.com/jbossdeveloper"&gt;JBoss Developer&lt;/a&gt; on &lt;a href="http://vimeo.com"&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-3956785598333717249?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/3956785598333717249/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=3956785598333717249' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3956785598333717249'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3956785598333717249'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/02/java-class-loading.html' title='Java Class Loading'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-1713930889378837455</id><published>2011-02-03T22:33:00.006+05:30</published><updated>2011-02-04T00:01:41.271+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Blogger'/><category scheme='http://www.blogger.com/atom/ns#' term='Tips'/><title type='text'>[Blogging] 10 Tips to get 1000 Hits per day</title><content type='html'>&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;  &lt;td&gt;1. Pick the most catching subject&lt;br /&gt;&lt;br /&gt;2. Make the content short and sweet&lt;br /&gt;&lt;br /&gt;- Essay like content doesn't help. Make the content as short as possible.&lt;br /&gt;- One image worths thousand words - use images whenever appropriate.&lt;br /&gt;- Use &lt;a href="http://blog.eviac.com/2010/11/publish-source-code-in-blogger-using.html"&gt;syntax-highlighters&lt;/a&gt; whenever you publish code.&lt;br /&gt;- Use spacing/gaps as necessary - to make the blog posts more readable&lt;br /&gt;- Use proper tags to tag your blog posts.&lt;br /&gt;- Don't make the blog looks crowded with too many widgets/gadgets.&lt;/td&gt;&lt;td&gt;&lt;img border="0" height="216" src="http://1.bp.blogspot.com/_K2WLYAmEH8g/TUrvyWk_VWI/AAAAAAAAAq8/aYe6zf1XvV4/s400/Screen%2Bshot%2B2011-02-03%2Bat%2B11.40.24%2BPM.png" width="208" /&gt;&lt;/td&gt;    &lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;3. Keep the blog updated regularly&lt;br /&gt;&lt;br /&gt;- Blog regularly and make sure you answer readers' comments&lt;br /&gt;- Frequent updates helps to improve Google page rank&lt;br /&gt;&lt;br /&gt;4. No anonymous blogging&lt;br /&gt;&lt;br /&gt;- Always blog with a human name. That will give the readers' the feeling of being real.&lt;br /&gt;- Post your email address or a way to contact you directly, in the blog&lt;br /&gt;&lt;br /&gt;5. Publish on &lt;a href="http://www.dzone.com/links/about.jsp"&gt;DZone&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- DZone is a technology publishing company that produces valuable content for software architects and developers worldwide. &lt;br /&gt;- It has a considerable amount of user base, highly focused on technology related topics.&lt;br /&gt;- Do not publish your links on Weekends.&lt;br /&gt;- Tag your DZone link properly&lt;br /&gt;- Share the DZone link [via DZone]&lt;br /&gt;- Make the DZone link description meaningful/attractive and readable. &lt;br /&gt;- Participate in discussions via comments to the link&lt;br /&gt;&lt;br /&gt;6. Publish on &lt;a href="http://www.reddit.com/"&gt;reddit&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;- Reddit is a social news website which has wide variety of topics.&lt;br /&gt;- Pick the most appropriate topic for your link.&lt;br /&gt;- Reddit has a huge user base compared to DZone.&lt;br /&gt;&lt;br /&gt;7. Tweet&lt;br /&gt;&lt;br /&gt;- Tweet about your blog post.&lt;br /&gt;- Use hash-tags appropriately.&lt;br /&gt;- Publish first in DZone and then Tweet the DZone link.&lt;br /&gt;- Use catching words to describe what you have in the blog post - it need to not be the title always.&lt;br /&gt;&lt;br /&gt;8. Share in Facebook&lt;br /&gt;&lt;br /&gt;- Post a link to your blog post in Facebook&lt;br /&gt;- Publish first in DZone and then share the DZone link&lt;br /&gt;&lt;br /&gt;9. Subscribe to blog aggregators&lt;br /&gt;&lt;br /&gt;- Subscribe to appropriate blog aggregators&lt;br /&gt;- Don't publish the entire blog post to feeds. Blogger has an option to limit number of words.&lt;br /&gt;&lt;br /&gt;10. Use SEO best practices to improve your Google Page Rank&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-1713930889378837455?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/1713930889378837455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=1713930889378837455' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1713930889378837455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1713930889378837455'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/02/blogging-10-tips-to-get-1000-hits-per.html' title='[Blogging] 10 Tips to get 1000 Hits per day'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_K2WLYAmEH8g/TUrvyWk_VWI/AAAAAAAAAq8/aYe6zf1XvV4/s72-c/Screen%2Bshot%2B2011-02-03%2Bat%2B11.40.24%2BPM.png' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-1825855746862942231</id><published>2011-02-01T06:43:00.002+05:30</published><updated>2011-02-01T06:49:42.466+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSAS'/><title type='text'>WSO2 Application Server 4.0</title><content type='html'>&lt;iframe title="YouTube video player" class="youtube-player" type="text/html" width="480" height="390" src="http://www.youtube.com/embed/9M1OZwDgYFs?showinfo=0" frameborder="0" allowFullScreen&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-1825855746862942231?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/1825855746862942231/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=1825855746862942231' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1825855746862942231'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1825855746862942231'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/02/wso2-application-server-40.html' title='WSO2 Application Server 4.0'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/9M1OZwDgYFs/default.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-6507754836611502941</id><published>2011-01-31T13:02:00.014+05:30</published><updated>2011-02-01T07:01:31.134+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security Gateway'/><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><title type='text'>Building an Enterprise SOA Security Gateway</title><content type='html'>I was looking for a 'formal' definition of 'SOA Security Gateway'. Failing to find such [yes, not even in Wikipedia] let's try to build one..&lt;br /&gt;&lt;br /&gt;Message Interceptor Gateway pattern is the one that directly comes in to my mind.. We have implemented this at many customers with WSO2 product stack.. ESB, IS, GReg and WSAS/DSS.&lt;br /&gt;&lt;br /&gt;This pattern provides a single entry point and allows centralization of security enforcement for incoming and outgoing messages. The security tasks include creating, modifying, and administering security policies for sending and receiving SOAP messages. It helps to apply transport-level and message-level security mechanisms required for securely communicating with a Web services endpoint.&lt;br /&gt;&lt;br /&gt;Isn't this the functionality we are looking from a Security Gateway..?&lt;br /&gt;&lt;br /&gt;BTW, if you are building a Security Gateway, you can't ignore &lt;a href="http://www.owasp.org/index.php/Category:OWASP_XML_Security_Gateway_Evaluation_Criteria_Project_Latest"&gt;OWASP XML Security Gateway Evaluation Criteria&lt;/a&gt; project.&lt;br /&gt;&lt;br /&gt;The OWASP XML Security Gateway Evaluation Criteria Project (XSGEC) defines an open standard for evaluating XML Security Gateways, such as those used to protect and provide security services for Web services applications. &lt;br /&gt;&lt;br /&gt;This project categorizes the evaluation criteria in to 9 sections.&lt;br /&gt;&lt;br /&gt;1. Authentication&lt;br /&gt;2. Authorization&lt;br /&gt;3. Audit Logging&lt;br /&gt;4. Deployment Architecture&lt;br /&gt;5. Content Validation&lt;br /&gt;6. Management &amp;amp; Metrics&lt;br /&gt;7. Transformation&lt;br /&gt;8. Tools&lt;br /&gt;9. Performance&lt;br /&gt;&lt;br /&gt;The authentication section describes the support at the service level and message level for inbound and outbound communication to the Security Gateway.&lt;br /&gt;&lt;br /&gt;In bound traffic can be protected with any of the following security techniques.&lt;br /&gt;&lt;br /&gt;- Mutual SSL&lt;br /&gt;- HTTP Basic Authentication&lt;br /&gt;- HTTP Digest Authentication&lt;br /&gt;- WS-Security Username Token Authentication&lt;br /&gt;- WS-Security X.509 Certificate Based Authentication&lt;br /&gt;- WS-Security: Kerberos Token&lt;br /&gt;- SAML Authentication assertion&lt;br /&gt;- Validation against Active Directory&lt;br /&gt;- Dereference Active Directory Federation Service&lt;br /&gt;&lt;br /&gt;Outbound traffic can be protected with following techniques..&lt;br /&gt;&lt;br /&gt;- Mutual SSL&lt;br /&gt;- HTTP Basic Authentication&lt;br /&gt;- HTTP Digest Authentication&lt;br /&gt;- WS-Security Username Token&lt;br /&gt;- WS-Security X.509 Certificate&lt;br /&gt;- WS-Security: Kerberos Token&lt;br /&gt;- SAML Authentication assertion&lt;br /&gt;- WS-Federation assertion&lt;br /&gt;&lt;br /&gt;Looking at the Authorization section - it covers,&lt;br /&gt;&lt;br /&gt;- XACML&lt;br /&gt;- SAML&lt;br /&gt;- LDAP&lt;br /&gt;&lt;br /&gt;Being part of the WSO2 Security team for years now, it's so natural to think, how we meet these criteria with WSO2 Product Stack..?&lt;br /&gt;&lt;br /&gt;In fact we do already... Only thing we lack is the full support for WS-Federation. Even a set of students from University of Moratuwa - currently working on adding WS-Federation support for Rampart - which is the security module of Axis2.&lt;br /&gt;&lt;br /&gt;To be more precise - we have already done this at some of our customers.&lt;br /&gt;&lt;br /&gt;Let me briefly share some of my experience with a customer who is highly concerned about security.&lt;br /&gt;&lt;br /&gt;They had the backend services already implemented with WCF and protected with Integrated Windows Authentication[IWA] - hosted in IIS.&lt;br /&gt;&lt;br /&gt;They have three types of clients who need access to the BE services.&lt;br /&gt;&lt;br /&gt;1. Windows Client&lt;br /&gt;2. C++ client running on a Linux box&lt;br /&gt;3. Third party client - out side their domain&lt;br /&gt;&lt;br /&gt;Windows client doesn't have any issues in accessing the BE services - with IWA.&lt;br /&gt;&lt;br /&gt;C++ client had some technical challenges. It is already developed and only way it supports securing the communication channel to the BE services is through BasicAuthentication.&lt;br /&gt;&lt;br /&gt;Third party client can be developed on any platform. The challenge is - we do not know how to authenticate users who are coming from a different domain - and they also need to integrate with internal windows authentication.&lt;br /&gt;&lt;br /&gt;Apart from this - we also need to authorize each and every user.&lt;br /&gt;&lt;br /&gt;Sounds interesting ? ;)&lt;br /&gt;&lt;br /&gt;Let me summarize the requirements..&lt;br /&gt;&lt;br /&gt;1. Windows Client -- [Authentication with Kerberos] -- [Authorization] -- &amp;gt; BE Services&lt;br /&gt;&lt;br /&gt;2. C++ client -- [Authentication with BasicAuthentication] -- [Authorization] -- [Authentication with Kerberos] --&amp;gt; BE Services&lt;br /&gt;&lt;br /&gt;3. Third Party client -- [Authentication?] -- [Authorization?] -- [Authentication with Kerberos] -- &amp;gt; BE Services&lt;br /&gt;&lt;br /&gt;We need define a method to authenticate third party users - who we do not have access to the credential store -- that is WS-Trust&lt;br /&gt;&lt;br /&gt;We need to do a credential conversion from BasicAuthentication to Kerberos and WS-Trust to Kerberos.&lt;br /&gt;&lt;br /&gt;Apart from this we need to have an authorization scheme as well.&lt;br /&gt;&lt;br /&gt;Let me explain our solution.&lt;br /&gt;&lt;br /&gt;We decided to have WSO2 ESB - acting as a security gateway - implementing the message interceptor gateway pattern.&lt;br /&gt;&lt;br /&gt;Also - we decided not to propagate end user credentials to the BE services. It's up to the ESB to authenticate and authorize users and occupy the trusted sub system pattern to authenticate to the BE with Kerberos.&lt;br /&gt;&lt;br /&gt;1. Windows Client -- [Authentication with Kerberos] --&amp;gt; ESB -- [Authorization with XACML] -- [Authenticating with Kerberos] -- &amp;gt; BE Services&lt;br /&gt;&lt;br /&gt;2. C++ client -- [Authentication with BasicAuthentication] --&amp;gt; ESB -- [Authorization with XACML] -- [Authentication with Kerberos] --&amp;gt; BE Services&lt;br /&gt;&lt;br /&gt;3. Third Party client -- [Authentication with WS-Trust] --&amp;gt; ESB [Authorization with XACML] -- [Authentication with Kerberos] -- &amp;gt; BE Services&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img  height="422" src="http://1.bp.blogspot.com/_K2WLYAmEH8g/TUbzhLZUIUI/AAAAAAAAAqo/1LO4oqgr074/s640/Screen%2Bshot%2B2011-01-31%2Bat%2B11.03.58%2BPM.png" width="640" /&gt;&lt;br /&gt;&lt;br /&gt;The above gives us a unified authentication and authorization scheme across three different clients.&lt;br /&gt;&lt;br /&gt;It's true that with this pattern we do not pass user credentials to the BE services. But, still we need to send the user name corresponding to the request to the BE. In that case we wrote a mediator to extract the user name from the incoming request and attach it to the out going message form the ESB to the BE services.&lt;br /&gt;&lt;br /&gt;Okay.. one last question.. It's clear that we can define an authorization scheme for internal users - based on their roles.. But.. how do we authorize third party users..?&lt;br /&gt;&lt;br /&gt;All the requests [based on WS-trust] are signed by the corresponding STS. So - with the signature - we can identify to who a particular user belongs to. Internally we define roles for each and every partner and once via the signature we identified the partner, we can easily figure out the mapped role that particular user belongs to. The XACML policy authorizes the user against this role.&lt;br /&gt;&lt;br /&gt;I guess that's pretty much the solution to that specific problem - although in my description I do not cover how to govern both the security policies and XACML policies - which should also be part of a Security Gateway Solution.&lt;br /&gt;&lt;br /&gt;If you are further interested in reading about more features that you should look into, while building a Security Gateway - it's highly recommended that you go through &lt;a href="http://www.dynamicperimeter.com/res/download/Security_Gateway_BuyersGuide.pdf"&gt;Security Gateway Buyer's Guide&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-6507754836611502941?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/6507754836611502941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=6507754836611502941' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6507754836611502941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6507754836611502941'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/01/building-enterprise-soa-security.html' title='Building an Enterprise SOA Security Gateway'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_K2WLYAmEH8g/TUbzhLZUIUI/AAAAAAAAAqo/1LO4oqgr074/s72-c/Screen%2Bshot%2B2011-01-31%2Bat%2B11.03.58%2BPM.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-2753391668304408342</id><published>2011-01-22T11:32:00.001+05:30</published><updated>2011-01-22T11:34:11.178+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SOAP'/><category scheme='http://www.blogger.com/atom/ns#' term='JSON'/><category scheme='http://www.blogger.com/atom/ns#' term='REST'/><category scheme='http://www.blogger.com/atom/ns#' term='XML'/><title type='text'>SOAP vs REST | XML vs JSON</title><content type='html'>&lt;div style="width:425px" id="__ss_2630924"&gt;&lt;object id="__sse2630924" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jsonandrest-091202051849-phpapp01&amp;stripped_title=json-and-rest&amp;userName=rmaclean" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed name="__sse2630924" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=jsonandrest-091202051849-phpapp01&amp;stripped_title=json-and-rest&amp;userName=rmaclean" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style="padding:5px 0 12px"&gt;View more &lt;a href="http://www.slideshare.net/"&gt;presentations&lt;/a&gt; from &lt;a href="http://www.slideshare.net/rmaclean"&gt;Robert MacLean&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-2753391668304408342?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/2753391668304408342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=2753391668304408342' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2753391668304408342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2753391668304408342'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/01/soap-vs-rest-xml-vs-json.html' title='SOAP vs REST | XML vs JSON'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-1571589533417374890</id><published>2011-01-21T01:13:00.005+05:30</published><updated>2011-01-21T10:19:57.535+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Facebook'/><title type='text'>Catch who removed you from Facebook...!</title><content type='html'>Facebook doesn't send notifications upon unfriending.. although it does when somebody added you.&lt;br /&gt;&lt;br /&gt;This blog post explains how to catch people who remove you from Facebook friend list.&lt;br /&gt;&lt;br /&gt;Before running the following java program, you need to do the following steps..&lt;br /&gt;&lt;br /&gt;0. Go to &lt;a href="http://www.facebook.com/#!/pages/Facebook-Developer/7213347185"&gt;http://www.facebook.com/#!/pages/Facebook-Developer/7213347185&lt;/a&gt; and LIKE that page.&lt;br /&gt;&lt;br /&gt;1. Go to &lt;a href="http://www.facebook.com/developers"&gt;http://www.facebook.com/developers&lt;/a&gt; and click on "Set Up New App"&lt;br /&gt;&lt;br /&gt;2. Once done with [1] - go to the link &lt;a href="http://developers.facebook.com/docs/reference/rest/auth.createtoken/"&gt;http://developers.facebook.com/docs/reference/rest/auth.createtoken&lt;/a&gt; and select your application from the "Test Console" and click on the link which looks like https://api.facebook.com/method/auth.createToken?&lt;br /&gt;access_token=...&lt;br /&gt;&lt;br /&gt;3. Now a new browser window will be opened up and from the Url - copy the access_token - which is in the query string. Make sure you properly copy the access_token value only - don't mess up with the other query string parameters present in the same Url.&lt;br /&gt;&lt;br /&gt;4. Replace the value of the constant ACCESS_TOKEN in code below with the one you got from [3].&lt;br /&gt;&lt;br /&gt;5. Download the RestFB jar from &lt;a href="http://code.google.com/p/restfb/downloads/detail?name=restfb-1.6.zip"&gt;here&lt;/a&gt; and add it to the classpath of the java program.&lt;br /&gt;&lt;br /&gt;6. That's it and whenever you run the following program you will see the friends you made and lost from your previous run.&lt;pre name="code" class="java"&gt;package samples.fb.app;&lt;br /&gt;&lt;br /&gt;import java.io.File;&lt;br /&gt;import java.io.FileInputStream;&lt;br /&gt;import java.io.FileOutputStream;&lt;br /&gt;import java.io.ObjectInputStream;&lt;br /&gt;import java.io.ObjectOutputStream;&lt;br /&gt;import java.util.Hashtable;&lt;br /&gt;import java.util.Iterator;&lt;br /&gt;import java.util.List;&lt;br /&gt;import java.util.Map.Entry;&lt;br /&gt;&lt;br /&gt;import com.restfb.Connection;&lt;br /&gt;import com.restfb.DefaultFacebookClient;&lt;br /&gt;import com.restfb.FacebookClient;&lt;br /&gt;import com.restfb.types.User;&lt;br /&gt;&lt;br /&gt;public class FacebookTestClient {&lt;br /&gt;&lt;br /&gt; private final static String ACCESS_TOKEN = "126895777dsd7843z4erer7C2.WfdfgQmjj376b_gfdfdf__.3600.1295557200-787236966%7CQ0166mXlhvmBoCXohUDVpfWrYAg";&lt;br /&gt;&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;&lt;br /&gt;  FacebookClient facebookClient = new DefaultFacebookClient(ACCESS_TOKEN);&lt;br /&gt;  Connection&amp;lt;User&gt; myFriends = facebookClient.fetchConnection("me/friends", User.class);&lt;br /&gt;&lt;br /&gt;  List&amp;lt;User&gt; list = myFriends.getData();&lt;br /&gt;  Hashtable&amp;lt;String, String&gt; newFriends = new Hashtable&amp;gt;String, String&gt;();&lt;br /&gt;  Hashtable&amp;lt;String, String&gt; oldFriends = loadOldFriends();&lt;br /&gt;&lt;br /&gt;  for (Iterator&amp;lt;User&gt; iterator = list.iterator(); iterator.hasNext();) {&lt;br /&gt;   User friend = iterator.next();&lt;br /&gt;   newFriends.put(friend.getId(), friend.getName());&lt;br /&gt;&lt;br /&gt;   if (oldFriends != null) {&lt;br /&gt;    if (!oldFriends.containsKey(friend.getId())) {&lt;br /&gt;     System.out.println("You have a new friend today, " + friend.getName());&lt;br /&gt;    }&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  if (oldFriends != null) {&lt;br /&gt;   for (Iterator&amp;lt;Entry&amp;lt;String, String&gt;&gt; iterator = oldFriends.entrySet().iterator(); iterator&lt;br /&gt;     .hasNext();) {&lt;br /&gt;    Entry&amp;lt;String, String&gt; friendEntry = iterator.next();&lt;br /&gt;    if (!newFriends.containsKey(friendEntry.getKey())) {&lt;br /&gt;     System.out.println("You lost a friend today, " + friendEntry.getValue());&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  saveFriends(newFriends);&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private static void saveFriends(Hashtable&amp;lt;String, String&gt; friends) {&lt;br /&gt;&lt;br /&gt;  try {&lt;br /&gt;   FileOutputStream fileOut = new FileOutputStream("friendlist.ser");&lt;br /&gt;   ObjectOutputStream out = new ObjectOutputStream(fileOut);&lt;br /&gt;   out.writeObject(friends);&lt;br /&gt;   out.close();&lt;br /&gt;   fileOut.close();&lt;br /&gt;  } catch (Exception e) {&lt;br /&gt;   e.printStackTrace();&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private static Hashtable&amp;lt;String, String&gt; loadOldFriends() {&lt;br /&gt;&lt;br /&gt;  Hashtable&amp;lt;String, String&gt; friends = null;&lt;br /&gt;&lt;br /&gt;  try {&lt;br /&gt;   if (new File("friendlist.ser").exists()) {&lt;br /&gt;    FileInputStream fileIn = new FileInputStream("friendlist.ser");&lt;br /&gt;    ObjectInputStream in = new ObjectInputStream(fileIn);&lt;br /&gt;    friends = (Hashtable&amp;lt;String, String&gt;) in.readObject();&lt;br /&gt;    in.close();&lt;br /&gt;    fileIn.close();&lt;br /&gt;   }&lt;br /&gt;  } catch (Exception e) {&lt;br /&gt;   e.printStackTrace();&lt;br /&gt;  }&lt;br /&gt;  return friends;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-1571589533417374890?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/1571589533417374890/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=1571589533417374890' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1571589533417374890'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1571589533417374890'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/01/catch-who-removed-you-from-facebook.html' title='Catch who removed you from Facebook...!'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-3578502882247460708</id><published>2011-01-06T04:27:00.003+05:30</published><updated>2011-01-09T11:50:20.525+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='SSLStrip'/><title type='text'>SSL stripping on OS X with SSLStrip</title><content type='html'>SSLStrip tool provides a demonstration of the HTTPS stripping attacks - you can download it from &lt;a href="http://www.thoughtcrime.org/software/sslstrip/sslstrip-0.7.tar.gz"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Then on OS X 10.6.5 with MacPorts we need to install following dependancies.&lt;br /&gt;&lt;br /&gt;1. $ sudo port selfupdate&lt;br /&gt;&lt;br /&gt;2. $ sudo port install py25-twisted-web2&lt;br /&gt;&lt;br /&gt;3. $ sudo port install py25-socket-ssl&lt;br /&gt;&lt;br /&gt;4. $ sudo port install py25-openssl&lt;br /&gt;&lt;br /&gt;Now, run the following from the SSLStrip home directory.&lt;br /&gt;&lt;br /&gt;$ sudo python sslstrip.py -l 9090 -w captured.log&lt;br /&gt;&lt;br /&gt;This will start SSLStrip listening on port 9090 - and will write all captured traffic in to the captured.log&lt;br /&gt;&lt;br /&gt;Now starts the interesting part.. We need to make the traffic from our target machine goes through SSLStrip. To do that first we need to make sure the traffic flows through our machine. That we can do by ARP poisoning target machine. My previous blog &lt;a href="http://blog.facilelogin.com/2011/01/arp-poisoning-with-dsniff.html"&gt;post&lt;/a&gt; explains how to do that. Once that is done - we need to forward all that incoming traffic to port where SSLStrip running.&lt;br /&gt;&lt;br /&gt;Enable IP forwarding on MAC.&lt;br /&gt;&lt;br /&gt;$ sudo sysctl -w net.inet.ip.forwarding=1&lt;br /&gt;$ sudo sysctl -w net.inet.ip.fw.verbose=1&lt;br /&gt;&lt;br /&gt;Now we need to add a rule to IPFW to redirect traffic to the port SSLStrip is running.&lt;br /&gt;&lt;br /&gt;$ sudo ipfw add fwd 127.0.0.1,9090 log tcp from not me to any 80&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-3578502882247460708?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/3578502882247460708/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=3578502882247460708' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3578502882247460708'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3578502882247460708'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/01/ssl-striping-on-os-x-with-sslstrip.html' title='SSL stripping on OS X with SSLStrip'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-8478054514477545980</id><published>2011-01-04T20:17:00.001+05:30</published><updated>2011-01-04T21:37:49.418+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Cryptography'/><title type='text'>History of cryptography and its early stages in Europe</title><content type='html'>Very nice presentation from &lt;a href="http://www.criptored.upm.es/intypedia/index.php?lang=en"&gt;http://www.criptored.upm.es/intypedia&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;object width="640" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/5Rz3fvRArcA?fs=1&amp;amp;hl=en_US"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/5Rz3fvRArcA?fs=1&amp;amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-8478054514477545980?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/8478054514477545980/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=8478054514477545980' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8478054514477545980'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8478054514477545980'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/01/history-of-cryptography-and-its-early.html' title='History of cryptography and its early stages in Europe'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-2184711281332016291</id><published>2011-01-04T17:27:00.001+05:30</published><updated>2011-01-04T17:30:50.328+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='arpspoof'/><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>ARP poisoning with dsniff</title><content type='html'>dsniff is a collection of tools for network auditing and penetration testing. dsniff, filesnarf, mailsnarf, msgsnarf, urlsnarf, and webspy passively monitor a network for interesting data (passwords, e-mail, files, etc.). arpspoof, dnsspoof, and macof facilitate the interception of network traffic normally unavailable to an attacker (e.g, due to layer-2 switching). sshmitm and webmitm implement active monkey-in-the-middle attacks against redirected SSH and HTTPS sessions by exploiting weak bindings in ad-hoc PKI.&lt;br /&gt;&lt;br /&gt;To install dsniff on MAC OS X - with MacPorts.&lt;br /&gt;&lt;br /&gt;$ sudo port install dsniff&lt;br /&gt;&lt;br /&gt;Now you need to find out two things,&lt;br /&gt;&lt;br /&gt;1. IP address of the target machine - say 192.168.1.4&lt;br /&gt;2. IP address of the Gateway - say 192.168.1.1&lt;br /&gt;&lt;br /&gt;Let's start ARP poisoning from the attacker's machine - with arpspoof tool which comes with dsniff.&lt;br /&gt;&lt;br /&gt;$ sudo arpspoof -i en1 -t 192.168.1.4  192.168.1.1&lt;br /&gt;&lt;br /&gt;This will update target machine's ARP table with attacker's MAC address against the IP address of the gateway.&lt;br /&gt;&lt;br /&gt;Now - start a tcpdump on the same interface from your machine - start viewing all the traffic going to and from the target machine.&lt;br /&gt;&lt;br /&gt;$ sudo tcpdump -i en1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-2184711281332016291?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/2184711281332016291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=2184711281332016291' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2184711281332016291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2184711281332016291'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/01/arp-poisoning-with-dsniff.html' title='ARP poisoning with dsniff'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-6827636402041543092</id><published>2011-01-04T11:16:00.003+05:30</published><updated>2011-01-04T11:22:08.802+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAX-WS'/><category scheme='http://www.blogger.com/atom/ns#' term='Axis2'/><title type='text'>Writing a JAX-WS client to an Axis2 web service</title><content type='html'>1. Deploying the Axis2 Service&lt;br /&gt;&lt;br /&gt;Download and launch Apache Axis2 - it comes with a sample web service which is by default available at http://localhost:8080/axis2/services/Version - we will be using this as the service to write our JAX-WS client.&lt;br /&gt;&lt;br /&gt;2. JAX-WS&lt;br /&gt;&lt;br /&gt;The Java API for XML Web Services (JAX-WS) is a Java programming language API for creating web services. It is part of the Java EE platform from Sun Microsystems. Like the other Java EE APIs, JAX-WS uses annotations, introduced in Java SE 5, to simplify the development and deployment of web service clients and endpoints.The Reference Implementation of JAX-WS is developed as an open source project and is part of project GlassFish.&lt;br /&gt;&lt;br /&gt;3. Axis2 and JAX-WS&lt;br /&gt;&lt;br /&gt;&lt;a href="http://axis.apache.org/axis2/java/core/docs/jaxws-guide.html"&gt;http://axis.apache.org/axis2/java/core/docs/jaxws-guide.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;4. JAX-WS client&lt;br /&gt;&lt;br /&gt;First we need to generate the Stub classes for the service we are going to invoke. This can be done using the &lt;b&gt;wsimport&lt;/b&gt; tool. The tool is available at [JAVA_HOME]\bin distribution.&lt;pre name="code" class="html"&gt;$ pwd&lt;br /&gt;/Users/prabath/blog/jax-ws&lt;br /&gt;$ wsimport -p org.wso2 http://localhost:8080/axis2/services/Version?wsdl&lt;/pre&gt;The above resulted with the following error.&lt;pre name="code" class="html"&gt;[ERROR] A class/interface with the same name "wso2.Exception" is already in use. Use a class customization to resolve this conflict.&lt;br /&gt;line 11 of http://localhost:8080/axis2/services/Version?wsdl&lt;br /&gt;&lt;/pre&gt;So I got to hand edit the wsdl and save it as &lt;a href="http://facilelogin.s3.amazonaws.com/wsdl.xml"&gt;wsdl.xml&lt;/a&gt; - and run wsimport against wsdl.xml&lt;pre name="code" class="html"&gt;$ pwd&lt;br /&gt;/Users/prabath/blog/jax-ws&lt;br /&gt;$ wsimport -p org.wso2 wsdl.xml&lt;br /&gt;$ jar -cvf version-stub.jar *&lt;br /&gt;&lt;/pre&gt;Following is the client code - and you need to have version-stub.jar, which was generated in the previous step.&lt;pre name="code" class="java"&gt;package jax.ws.client;&lt;br /&gt;&lt;br /&gt;import javax.xml.ws.WebServiceRef;&lt;br /&gt;&lt;br /&gt;import org.wso2.Version;&lt;br /&gt;import org.wso2.VersionPortType;&lt;br /&gt;&lt;br /&gt;public class VersionClient {&lt;br /&gt; @WebServiceRef(wsdlLocation = "http://localhost:8080/axis2/services/Version?wsdl")&lt;br /&gt;&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;  try {&lt;br /&gt;   Version service = new Version();&lt;br /&gt;   VersionPortType port = service.getVersionHttpSoap11Endpoint();&lt;br /&gt;   String response = port.getVersion().getReturn().getValue();&lt;br /&gt;   System.out.println(response);&lt;br /&gt;  } catch (Exception e) {&lt;br /&gt;   e.printStackTrace();&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-6827636402041543092?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/6827636402041543092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=6827636402041543092' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6827636402041543092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6827636402041543092'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/01/writing-jax-ws-client-to-axis2-service.html' title='Writing a JAX-WS client to an Axis2 web service'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-5731806944534017356</id><published>2011-01-03T16:57:00.007+05:30</published><updated>2011-01-04T11:16:33.160+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='JAX-RPC'/><title type='text'>Writing a JAX-RPC client to an Axis2 web service</title><content type='html'>1. Deploying the Axis2 Service&lt;br /&gt;&lt;br /&gt;Download and launch Apache Axis2 - it comes with a sample web service which is by default available at http://localhost:8080/axis2/services/Version - we will be using this as the service to write our JAX-RPC client.&lt;br /&gt;&lt;br /&gt;2. JAX-RPC&lt;br /&gt;&lt;br /&gt;JAX-RPC is intended to be a Java API to expose remote procedure calls that use XML to business applications and it facilitates the invocation of remote procedures using XML as the data format and SOAP as the data protocol. The overhead in developing JAX-RPC clients is minimal since the API it self abstracts and hides the low level SOAP semantics associated with RPC from applications.&lt;br /&gt;&lt;br /&gt;3. Axis2 and JAX-RPC&lt;br /&gt;&lt;br /&gt;Although Axis [version - 1] had support for JAX-RPC - Axis2 does not. Axis2 has the support for JAX-WS - JAX-WS 2.0 is the successor of JAX-RPC 1.1 - the Java API for XML-based Web services. If possible, JAX-WS should be used instead as it is based on the most recent industry standards.&lt;br /&gt;&lt;br /&gt;4. JAX-RPC client&lt;br /&gt;&lt;br /&gt;First we need to generate the Stub classes for the service we are going to invoke. This can be done using the &lt;b&gt;wscompile&lt;/b&gt; tool. The tool is available with the &lt;a href="http://glassfish.java.net/downloads/3.0.1-final.html"&gt;GlassFish&lt;/a&gt; distribution.&lt;br /&gt;&lt;br /&gt;wscompile tool needs a configuration file as an input - which dictates where to find the corresponding WSDL and the required package names for the stubs to be generated. Let's first create that config file, say version-config.xml&lt;pre name="code" class="html"&gt;&amp;lt;configuration xmlns=&amp;quot;http://java.sun.com/xml/ns/jax-rpc/ri/config&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;wsdl location=&amp;quot;http://localhost:8080/axis2/services/Version?wsdl&amp;quot; packageName=&amp;quot;org.wso2&amp;quot;/&amp;gt;&lt;br /&gt; &amp;lt;/configuration&amp;gt;&lt;/pre&gt;Now lets generate the stubs with the wscompile tool. &lt;pre name="code" class="html"&gt;$ pwd&lt;br /&gt;/Users/prabath/blog/jax-rpc&lt;br /&gt;$ sh ~/glassfishv3/glassfish/bin/wscompile -gen:client version-config.xml&lt;br /&gt;$ jar -cvf version-stub.jar *&lt;/pre&gt;Following is the client code - and you need to have version-stub.jar, which was generated in the previous step and javaee.jar from [GLASSFISH_HOME]/glassfish/lib&lt;pre name="code" class="java"&gt;package jax.rpc.client;&lt;br /&gt;&lt;br /&gt;import javax.xml.rpc.Stub;&lt;br /&gt;&lt;br /&gt;import org.wso2.VersionPortType_Stub;&lt;br /&gt;import org.wso2.Version_Impl;&lt;br /&gt;&lt;br /&gt;public class VersionClient {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; public static void main(String[] args) {&lt;br /&gt;&lt;br /&gt;  try {&lt;br /&gt;   Stub stub = createProxy();&lt;br /&gt;   stub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,&lt;br /&gt;     "http://localhost:8080/axis2/services/Version");&lt;br /&gt;   VersionPortType_Stub hello = (VersionPortType_Stub) stub;&lt;br /&gt;   System.out.println(hello.getVersion());&lt;br /&gt;  } catch (Exception ex) {&lt;br /&gt;   ex.printStackTrace();&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; private static Stub createProxy() {&lt;br /&gt;  return (Stub) new Version_Impl().getVersionHttpSoap11Endpoint();&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;}&lt;/pre&gt;5. JAX-RPC Vs JAX-WS&lt;br /&gt;&lt;br /&gt;JAX-WS still supports SOAP 1.1 over HTTP 1.1, so interoperability will not be affected. The same messages can still flow across the wire.&lt;br /&gt;&lt;br /&gt;JAX-WS still supports WSDL 1.1 so what you've learned about that specification is still useful.&lt;br /&gt;&lt;br /&gt;What are the differences?&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;SOAP 1.2&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;JAX-RPC and JAX-WS support SOAP 1.1. JAX-WS also supports SOAP 1.2.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;XML/HTTP&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;The WSDL 1.1 specification defined an HTTP binding, which is a means by which you can send XML messages over HTTP without SOAP. JAX-RPC ignored the HTTP binding. JAX-WS adds support for it.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;WS-I's Basic Profiles&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;JAX-RPC supports WS-I's Basic Profile (BP) version 1.0. JAX-WS supports BP 1.1. (WS-I is the web services interoperability organization.)&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;New Java features&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;JAX-RPC maps to Java 1.4. JAX-WS maps to Java 5.0. JAX-WS relies on many of the features new in Java 5.0.&lt;br /&gt;Java EE 5, the successor to J2EE 1.4, adds support for JAX-WS, but it also retains support for JAX-RPC, which could be confusing to today's web services novices.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;The data mapping model&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;JAX-RPC has its own data mapping model, which covers about 90 percent of all schema types. Those that it does not cover are mapped to javax.xml.soap.SOAPElement.&lt;br /&gt;JAX-WS's data mapping model is JAXB. JAXB promises mappings for all XML schemas.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;The interface mapping model&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;JAX-WS's basic interface mapping model is not extensively different from JAX-RPC's; however:&lt;br /&gt;JAX-WS's model makes use of new Java 5.0 features.&lt;br /&gt;JAX-WS's model introduces asynchronous functionality.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;The dynamic programming model&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;JAX-WS's dynamic client model is quite different from JAX-RPC's. Many of the changes acknowledge industry needs:&lt;br /&gt;It introduces message-oriented functionality.&lt;br /&gt;It introduces dynamic asynchronous functionality.&lt;br /&gt;JAX-WS also adds a dynamic server model, which JAX-RPC does not have.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;MTOM (Message Transmission Optimization Mechanism)&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;JAX-WS, via JAXB, adds support for MTOM, the new attachment specification. Microsoft never bought into the SOAP with Attachments specification; but it appears that everyone supports MTOM, so attachment interoperability should become a reality.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;The handler model&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;The handler model has changed quite a bit from JAX-RPC to JAX-WS.&lt;br /&gt;JAX-RPC handlers rely on SAAJ 1.2. JAX-WS handlers rely on the new SAAJ 1.3 specification&lt;br /&gt;&lt;br /&gt;Reference : &lt;a href="http://www.ibm.com/developerworks/webservices/library/ws-tip-jaxwsrpc.html"&gt;http://www.ibm.com/developerworks/webservices/library/ws-tip-jaxwsrpc.htm&lt;/a&gt;l&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-5731806944534017356?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/5731806944534017356/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=5731806944534017356' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5731806944534017356'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5731806944534017356'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2011/01/writing-jax-rpc-client-to-axis2-web.html' title='Writing a JAX-RPC client to an Axis2 web service'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-2534758226208103822</id><published>2010-12-28T10:32:00.001+05:30</published><updated>2010-12-28T10:39:30.017+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Carbon 3.0.x'/><category scheme='http://www.blogger.com/atom/ns#' term='ESB'/><title type='text'>ERROR - ProxyService Error reading from wsdl URI</title><content type='html'>$subject could be a common error for many new ESB users - so, thought of keeping a note here.&lt;br /&gt;&lt;br /&gt;This could easily happen if you create a proxy service against the sample echo service which ships with WSO2 ESB - and WSDL was pointed with an URI - and the corresponding WSDL is unavailable at the time proxy service been deployed [i.e. When the ESB is restarted]&lt;br /&gt;&lt;br /&gt;&amp;lt;publishWSDL uri=&amp;quot;http://localhost:8280/services/echo?wsdl&amp;quot;/&amp;gt;&lt;br /&gt;&lt;br /&gt;To recover from this error - you need to edit the file [ESB_HOME]/repository/conf/synapse-config/proxy-services/your_service_name.xml and add the following parameter..&lt;pre name="code" class="html"&gt;&amp;lt;proxy name=&amp;quot;test&amp;quot; transports=&amp;quot;https http&amp;quot; startOnLoad=&amp;quot;true&amp;quot; trace=&amp;quot;disable&amp;quot;&amp;gt;&lt;br /&gt;         ..............&lt;br /&gt;         ..................&lt;br /&gt;        &amp;lt;parameter name=&amp;quot;enablePublishWSDLSafeMode&amp;quot;&amp;gt;true&amp;lt;/parameter&amp;gt;&lt;br /&gt;    &amp;lt;/proxy&amp;gt;&lt;/pre&gt;&lt;br /&gt;Now restart the ESB and you will notice that this particular proxy service is not loaded - but the ESB starts fine.&lt;br /&gt;&lt;br /&gt;To handle this issue in a more generic way - a fail-safe mode to be introduced in to the upcoming release of WSO2 ESB - further &lt;a href="https://issues.apache.org/jira/browse/SYNAPSE-677"&gt;details&lt;/a&gt; here...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-2534758226208103822?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/2534758226208103822/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=2534758226208103822' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2534758226208103822'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2534758226208103822'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/error-proxyservice-error-reading-from.html' title='ERROR - ProxyService Error reading from wsdl URI'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-1670593833081652630</id><published>2010-12-27T21:42:00.003+05:30</published><updated>2010-12-27T21:46:29.879+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><title type='text'>Enforcing JDBC clients to use SSL with MySQL Server</title><content type='html'>1. First you need to enable SSL at both the server and the client as per my &lt;a href="http://blog.facilelogin.com/2010/12/connecting-wso2-carbon-server-to-mysql.html"&gt;previous&lt;/a&gt; blog post.&lt;br /&gt;&lt;br /&gt;2. There you would have noticed that - even though we enabled SSL at the server end - still the JDBC clients can connect with out using SSL.&lt;br /&gt;&lt;br /&gt;3. To enforce SSL for the JDBC connection from the client end - we need to have REQUIRE SSL - in the GRANT statement for the MySQL user associated with the JDBC client.&lt;br /&gt;&lt;br /&gt;e.g :&lt;br /&gt;&lt;br /&gt;GRANT ALL ON regdb.* TO regadmin@localhost IDENTIFIED BY "regadmin" REQUIRE SSL;&lt;br /&gt;&lt;br /&gt;4. Now regadmin user won't be able to connect to the regdb database without a JDBC connection over SSL.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-1670593833081652630?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/1670593833081652630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=1670593833081652630' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1670593833081652630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1670593833081652630'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/enforcing-jdbc-connection-to-use-ssl.html' title='Enforcing JDBC clients to use SSL with MySQL Server'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-2488301079556289834</id><published>2010-12-27T05:27:00.000+05:30</published><updated>2010-12-27T05:27:55.413+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Novell'/><category scheme='http://www.blogger.com/atom/ns#' term='Carbon 3.1.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Carbon 3.0.x'/><title type='text'>Deploying WSO2 Carbon Server over Novell eDirectory</title><content type='html'>Recently we did the $subject in a production deployment and thought of keeping a small note here.&lt;br /&gt;&lt;br /&gt;I blogged about the $subject sometime back &lt;a href="http://blog.facilelogin.com/2009/11/integratng-novell-edirectory-with-wso2.html"&gt;here&lt;/a&gt; - but that is no more applicable to Carbon 3.0.x products.&lt;br /&gt;&lt;br /&gt;To deploy WSO2 Carbon Server over Novell eDirectory - you can follow the exact guidelines provided in &lt;a href="http://blog.facilelogin.com/2010/12/deploying-wso2-carbon-over-ldap-user.html"&gt;this&lt;/a&gt; blog post - following is the only exception.&lt;br /&gt;&lt;br /&gt;Instead of setting &lt;b&gt;objectClass=person&lt;/b&gt; under &lt;b&gt;UserNameListFilter&lt;/b&gt; property - set, &lt;b&gt;objectClass=Person&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Note : 'P' is in upper-case there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-2488301079556289834?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/2488301079556289834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=2488301079556289834' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2488301079556289834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2488301079556289834'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/deploying-wso2-carbon-server-over_27.html' title='Deploying WSO2 Carbon Server over Novell eDirectory'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-80505675179542440</id><published>2010-12-26T17:54:00.009+05:30</published><updated>2010-12-27T04:43:43.885+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Carbon 3.1.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Carbon 3.0.x'/><title type='text'>Connecting WSO2 Carbon Server to a MySQL DB over a Secured Channel</title><content type='html'>In my &lt;a href="http://blog.facilelogin.com/2010/12/deploying-wso2-identity-server-over.html"&gt;previous&lt;/a&gt; blog post I explain how to connect WSO2 Carbon Server to a MySQL database. Please make sure it works fine before going through this.&lt;br /&gt;&lt;br /&gt;In this blog post I will only explain changes required to enable SSL.&lt;br /&gt;&lt;br /&gt;SSL in MySQL Connector/J encrypts all data (other than the initial handshake) between the JDBC driver and the server. The performance penalty for enabling SSL is an increase in query processing time between 35% and 50%, depending on the size of the query, and the amount of data it returns.&lt;br /&gt;&lt;br /&gt;1. Verify whether your MySQL distribution supports SSL. Use following command and make sure it doesn't result with an Error.&lt;pre name="code" class="html"&gt;$ cd /usr/local/mysql&lt;br /&gt;&lt;br /&gt;$ sudo ./bin/mysqld_safe --ssl&lt;br /&gt;101226 13:50:26 mysqld_safe Logging to '/usr/local/mysql-5.1.51-osx10.6-x86_64/data/prabath-siriwardenas-MacBook-Pro.local.err'.&lt;br /&gt;101226 13:50:26 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql-5.1.51-osx10.6-x86_64/data&lt;/pre&gt;2. Then login to the mysql and run the following query. &lt;pre name="code" class="html"&gt;mysql&gt; SHOW VARIABLES LIKE 'have_ssl';&lt;br /&gt;+---------------+-------+&lt;br /&gt;| Variable_name | Value |&lt;br /&gt;+---------------+-------+&lt;br /&gt;| have_ssl      | YES   |&lt;br /&gt;+---------------+-------+&lt;br /&gt;1 row in set (0.00 sec)&lt;/pre&gt;3. If all works fine - then your MySQL distribution is enabled for SSL.&lt;br /&gt;&lt;br /&gt;4. Now we need to set certificate to the MySQL Server. Here I am generating certificates with OpenSSL and copy them to /usr/local/mysql/ssl [If you don't see a directory 'ssl' - just create one there.]&lt;br /&gt;&lt;pre name="code" class="html"&gt;$ pwd&lt;br /&gt;/usr/local/mysql/ssl&lt;br /&gt;&lt;br /&gt;$ openssl  req -x509 -newkey rsa:1024 -keyout server-key.key -out server-cert.pem&lt;br /&gt;&lt;br /&gt;$ cp server-cert.pem ca-cert.pem&lt;br /&gt;&lt;br /&gt;$ openssl rsa -in server-key.key -out server-key.pem&lt;/pre&gt;&lt;br /&gt;5. Stop the running mysql server and start it as below.&lt;pre name="code" class="html"&gt;$ cd /usr/local/mysql&lt;br /&gt;&lt;br /&gt;$ sudo  ./bin/mysqld_safe  --ssl-ca=/usr/local/mysql/ssl/ca-cert.pem  --ssl-cert=/usr/local/mysql/ssl/server-cert.pem  --ssl-key=/usr/local/mysql/ssl/server-key.pem&lt;br /&gt; &lt;br /&gt;101226 18:16:42 mysqld_safe Logging to '/usr/local/mysql-5.1.51-osx10.6-x86_64/data/prabath-siriwardenas-MacBook-Pro.local.err'.&lt;br /&gt;101226 18:16:42 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql-5.1.51-osx10.6-x86_64/data&lt;/pre&gt;6. Once again login to the mysql and run the following query. &lt;pre name="code" class="html"&gt;mysql&gt; SHOW VARIABLES LIKE '%ssl%';&lt;br /&gt;+---------------+--------------------------------------+&lt;br /&gt;| Variable_name | Value                                |&lt;br /&gt;+---------------+--------------------------------------+&lt;br /&gt;| have_openssl  | YES                                  |&lt;br /&gt;| have_ssl      | YES                                  |&lt;br /&gt;| ssl_ca        | /usr/local/mysql/ssl/ca-cert.pem     |&lt;br /&gt;| ssl_capath    |                                      |&lt;br /&gt;| ssl_cert      | /usr/local/mysql/ssl/server-cert.pem |&lt;br /&gt;| ssl_cipher    |                                      |&lt;br /&gt;| ssl_key       | /usr/local/mysql/ssl/server-key.pem  |&lt;br /&gt;+---------------+--------------------------------------+&lt;br /&gt;7 rows in set (0.01 sec)&lt;/pre&gt;7. That's it we all need from the MySQL Server end.&lt;br /&gt;&lt;br /&gt;8. Now you need to import the public certificate and the CA certificate of MySQL server to [CARBON_HOME]\resources\security\client-truststore.jks. But in this case since we use verifyServerCertificate=false in the JDBC connection url of the WSO2 Carbon Server - we can skip this step.&lt;br /&gt;&lt;br /&gt;9. Now in both the user-mgt.xml and registry.xml we need to edit the ConnectionUrl and add useSSL=true, verifyServerCertificate=false and requireSSL=true.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;jdbc:mysql://localhost:3306/regdb?verifyServerCertificate=false&amp;amp;useSSL=true&amp;amp;requireSSL=true&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-80505675179542440?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/80505675179542440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=80505675179542440' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/80505675179542440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/80505675179542440'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/connecting-wso2-carbon-server-to-mysql.html' title='Connecting WSO2 Carbon Server to a MySQL DB over a Secured Channel'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-5519895245502955157</id><published>2010-12-26T17:00:00.001+05:30</published><updated>2010-12-26T17:02:42.220+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Carbon 3.1.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Carbon 3.0.x'/><title type='text'>Deploying WSO2 Carbon Server over a secured LDAP [s] connection</title><content type='html'>Please refer my &lt;a href="http://blog.facilelogin.com/2010/12/deploying-wso2-carbon-over-ldap-user.html"&gt;previous&lt;/a&gt; blog post to see how to deploy WSO2 Carbon Server over a LDAP User Store.&lt;br /&gt;&lt;br /&gt;I will highlight only the changes from there - when it comes to a secured LDAP connection.&lt;br /&gt;&lt;br /&gt;1. Change the ConnectionURL and set ldaps instead of ldap and set the port correctly.&lt;br /&gt;&lt;br /&gt;2. Import the LDAP server's SSL certificate in DER format to [CARBON_HOME]\resources\security\client-truststore.jks. If the certificate is not in DER format you can use OpenSSL to convert it to DER.&lt;br /&gt;&lt;br /&gt;3. When starting the Carbon Server - start as following.&lt;br /&gt;&lt;br /&gt;$ sh wso2server.sh -Djavax.net.ssl.trustStore=/[CARBON_HOME]/resources/security/client-truststore.jks -Djavax.net.ssl.trustStorePassword=wso2carbon&lt;br /&gt;&lt;br /&gt;There replace [CARBON_HOME] with your absolute path to CARBON_HOME.&lt;br /&gt;&lt;br /&gt;That's it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-5519895245502955157?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/5519895245502955157/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=5519895245502955157' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5519895245502955157'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5519895245502955157'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/deploying-wso2-carbon-server-over.html' title='Deploying WSO2 Carbon Server over a secured LDAP [s] connection'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-3845368665628043923</id><published>2010-12-26T16:35:00.007+05:30</published><updated>2010-12-26T16:50:10.034+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Carbon 3.1.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Carbon 3.0.x'/><title type='text'>Deploying WSO2 Carbon over an LDAP User Store</title><content type='html'>Open up the [CARBON_HOME]\repository\conf\user-mgt.xml and replace it's content with the following.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;ConnectionURL&lt;/b&gt;     : Connection URL to the LDAP server&lt;br /&gt;&lt;b&gt;ConnectionName&lt;/b&gt;    : Full qualified name of a user to access the LDAP server.&lt;br /&gt;&lt;b&gt;ConnectionPassword&lt;/b&gt;: Password of the ConnectionName. If you allow anonymous access keep this blank.&lt;br /&gt;&lt;b&gt;UserSearchBase&lt;/b&gt;    : Where the system should find the users - ConnectionName should be within the UserSearchBase&lt;br /&gt;&lt;b&gt;UserNameListFilter&lt;/b&gt;: This is to narrow down the search. Set the objectClass properly.&lt;br /&gt;&lt;b&gt;UserNameAttribute&lt;/b&gt; : This should be attribute where the system will take as the user name for login.&lt;br /&gt;&lt;b&gt;ReadLDAPGroups&lt;/b&gt;    : If true will read groups from the LDAP server.&lt;br /&gt;&lt;b&gt;GroupSearchBase&lt;/b&gt;   : Where the system should find the groups.&lt;br /&gt;&lt;b&gt;GroupSearchFilter&lt;/b&gt; : This is to narrow down the search. Set the objectClass properly.&lt;br /&gt;&lt;b&gt;GroupNameAttribute&lt;/b&gt;: This should be attribute where the system will take as the group name.&lt;br /&gt;&lt;b&gt;AdminUser/UserName&lt;/b&gt;: This user will be treated as the initial admin of the system. Should be belonging to the UserSearchBase in LDAP. Keep the password of this user blank.&lt;pre name="code" class="html"&gt;&amp;lt;UserManager&amp;gt;&lt;br /&gt;    &amp;lt;Realm&amp;gt;&lt;br /&gt;        &amp;lt;Configuration&amp;gt;&lt;br /&gt;                &amp;lt;AdminRole&amp;gt;admin&amp;lt;/AdminRole&amp;gt;&lt;br /&gt;                &amp;lt;AdminUser&amp;gt;&lt;br /&gt;                     &amp;lt;UserName&amp;gt;prabath&amp;lt;/UserName&amp;gt;&lt;br /&gt;                     &amp;lt;Password&amp;gt;XXXXXX&amp;lt;/Password&amp;gt;&lt;br /&gt;                &amp;lt;/AdminUser&amp;gt;&lt;br /&gt;            &amp;lt;EveryOneRoleName&amp;gt;everyone&amp;lt;/EveryOneRoleName&amp;gt; &amp;lt;!-- By default users in thsi role sees the registry root --&amp;gt;&lt;br /&gt;            &amp;lt;ReadOnly&amp;gt;true&amp;lt;/ReadOnly&amp;gt;&lt;br /&gt;            &amp;lt;MaxUserNameListLength&amp;gt;500&amp;lt;/MaxUserNameListLength&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;url&amp;quot;&amp;gt;jdbc:h2:repository/database/WSO2CARBON_DB&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;userName&amp;quot;&amp;gt;wso2carbon&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;password&amp;quot;&amp;gt;wso2carbon&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;driverName&amp;quot;&amp;gt;org.h2.Driver&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;maxActive&amp;quot;&amp;gt;50&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;maxWait&amp;quot;&amp;gt;60000&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;minIdle&amp;quot;&amp;gt;5&amp;lt;/Property&amp;gt;&lt;br /&gt;        &amp;lt;/Configuration&amp;gt;&lt;br /&gt;        &amp;lt;UserStoreManager&lt;br /&gt;            class=&amp;quot;org.wso2.carbon.user.core.ldap.LDAPUserStoreManager&amp;quot;&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;ConnectionURL&amp;quot;&amp;gt;ldap://localhost:10389&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;ConnectionName&amp;quot;&amp;gt;uid=admin,ou=system&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;ConnectionPassword&amp;quot;&amp;gt;secret&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;UserSearchBase&amp;quot;&amp;gt;ou=system&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;UserNameListFilter&amp;quot;&amp;gt;(objectClass=person)&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;UserNameAttribute&amp;quot;&amp;gt;uid&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;ReadLDAPGroups&amp;quot;&amp;gt;false&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;GroupSearchBase&amp;quot;&amp;gt;ou=system&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;GroupSearchFilter&amp;quot;&amp;gt;(objectClass=groupOfNames)&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;GroupNameAttribute&amp;quot;&amp;gt;cn&amp;lt;/Property&amp;gt;&lt;br /&gt;            &amp;lt;Property name=&amp;quot;MembershipAttribute&amp;quot;&amp;gt;member&amp;lt;/Property&amp;gt;&lt;br /&gt;        &amp;lt;/UserStoreManager&amp;gt;&lt;br /&gt;        &amp;lt;AuthorizationManager&lt;br /&gt;            class=&amp;quot;org.wso2.carbon.user.core.authorization.JDBCAuthorizationManager&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;/AuthorizationManager&amp;gt; &lt;br /&gt;    &amp;lt;/Realm&amp;gt;&lt;br /&gt;&amp;lt;/UserManager&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-3845368665628043923?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/3845368665628043923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=3845368665628043923' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3845368665628043923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3845368665628043923'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/deploying-wso2-carbon-over-ldap-user.html' title='Deploying WSO2 Carbon over an LDAP User Store'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-4554022259736249134</id><published>2010-12-26T16:20:00.000+05:30</published><updated>2010-12-26T16:20:06.351+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSO2'/><category scheme='http://www.blogger.com/atom/ns#' term='Identity Server 3.0'/><title type='text'>Deploying WSO2 Identity Server over MySQL</title><content type='html'>My &lt;a href="http://blog.facilelogin.com/2010/12/installing-mysql-community-server-and.html"&gt;previous&lt;/a&gt; blog post explains setting up MySQL Server and related tools under Mac OS X.&lt;br /&gt;&lt;br /&gt;Once you are done with setting up MySQL - login as a root and execute the following SQL. You can use MySQL Workbench for this.&lt;pre name="code" class="html"&gt;create database regdb;&lt;br /&gt;&lt;br /&gt;use regdb;&lt;br /&gt;&lt;br /&gt;GRANT ALL ON regdb.* TO regadmin@localhost IDENTIFIED BY "regadmin"&lt;br /&gt;&lt;/pre&gt;Once that is done. Open up the [IDENTITY_SERVER_HOME]\repository\conf\registry.xml and add the following section under &amp;lt;wso2registry&amp;gt;.&lt;pre name="code" class="html"&gt;&amp;lt;dbConfig name=&amp;quot;mysql-db&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;url&amp;gt;jdbc:mysql://localhost:3306/regdb&amp;lt;/url&amp;gt;&lt;br /&gt;        &amp;lt;userName&amp;gt;regadmin&amp;lt;/userName&amp;gt;&lt;br /&gt;        &amp;lt;password&amp;gt;regadmin&amp;lt;/password&amp;gt;&lt;br /&gt;        &amp;lt;driverName&amp;gt;com.mysql.jdbc.Driver&amp;lt;/driverName&amp;gt;&lt;br /&gt;        &amp;lt;maxActive&amp;gt;80&amp;lt;/maxActive&amp;gt;&lt;br /&gt;        &amp;lt;maxWait&amp;gt;60000&amp;lt;/maxWait&amp;gt;&lt;br /&gt;        &amp;lt;minIdle&amp;gt;5&amp;lt;/minIdle&amp;gt;&lt;br /&gt;&amp;lt;/dbConfig&amp;gt;&lt;br /&gt;&lt;/pre&gt;Now, find &amp;lt;currentDBConfig&amp;gt; in registry.xml and set it to mysql-db.&lt;br /&gt;&lt;br /&gt;That's it for the registry.&lt;br /&gt;&lt;br /&gt;Now, we need to set User Manager database pointing to the MySQl DB.&lt;br /&gt;&lt;br /&gt;Open up the [IDENTITY_SERVER_HOME]\repository\conf\user-mgt.xml and edit following settings.&lt;pre name="code" class="html"&gt;  &amp;lt;Configuration&amp;gt;&lt;br /&gt;        ...&lt;br /&gt;        &amp;lt;Property name=&amp;quot;url&amp;quot;&amp;gt;jdbc:mysql://localhost:3306/regdb&amp;lt;/Property&amp;gt;&lt;br /&gt;        &amp;lt;Property name=&amp;quot;userName&amp;quot;&amp;gt;regadmin&amp;lt;/Property&amp;gt;&lt;br /&gt;        &amp;lt;Property name=&amp;quot;password&amp;quot;&amp;gt;regadmin&amp;lt;/Property&amp;gt;&lt;br /&gt;        &amp;lt;Property name=&amp;quot;driverName&amp;quot;&amp;gt;com.mysql.jdbc.Driver&amp;lt;/Property&amp;gt;&lt;br /&gt;        &amp;lt;Property name=&amp;quot;maxActive&amp;quot;&amp;gt;50&amp;lt;/Property&amp;gt;&lt;br /&gt;        &amp;lt;Property name=&amp;quot;maxWait&amp;quot;&amp;gt;60000&amp;lt;/Property&amp;gt;&lt;br /&gt;        &amp;lt;Property name=&amp;quot;minIdle&amp;quot;&amp;gt;5&amp;lt;/Property&amp;gt;&lt;br /&gt;    &amp;lt;/Configuration&lt;br /&gt;&lt;/pre&gt;Then you need to copy the MySQL DBC driver from http://dev.mysql.com/downloads/connector/j/5.1.html and Place it in the $IDENTITY_SERVER_HOME/repository/components/lib directory.&lt;br /&gt;&lt;br /&gt;That's it - and start the identity server as sh bin/wso2server.sh -Dsetup&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-4554022259736249134?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/4554022259736249134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=4554022259736249134' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4554022259736249134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4554022259736249134'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/deploying-wso2-identity-server-over.html' title='Deploying WSO2 Identity Server over MySQL'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-6245849997378831337</id><published>2010-12-26T15:10:00.003+05:30</published><updated>2010-12-26T15:25:50.863+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>Installing MySQL Community Server and related tools in Apple Mac OS X</title><content type='html'>1. Download MySQL for MAC OS X from &lt;a href="http://dev.mysql.com/downloads/mysql/"&gt;here&lt;/a&gt; and install it.&lt;br /&gt;&lt;br /&gt;2. To start the MySQL server&lt;pre name="code" class="html"&gt;$ cd /usr/local/mysql&lt;br /&gt;&lt;br /&gt;$ sudo ./bin/mysqld_safe&lt;br /&gt;101226 13:50:26 mysqld_safe Logging to '/usr/local/mysql-5.1.51-osx10.6-x86_64/data/prabath-siriwardenas-MacBook-Pro.local.err'.&lt;br /&gt;101226 13:50:26 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql-5.1.51-osx10.6-x86_64/data&lt;/pre&gt;mysqld_safe is the recommended way to start a mysqld server on Unix and NetWare. mysqld_safe adds some safety features such as restarting the server when an error occurs and logging runtime information to an error log file.&lt;br /&gt;&lt;br /&gt;3.Now you can download MySQL GUI tools for Mac OS X from &lt;a href="http://dev.mysql.com/downloads/gui-tools/5.0.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;4. Once MySQL GUI tools installed - you can click on MySQL Administrator and login as root with blank password - then go to Accounts and change the root password.&lt;br /&gt;&lt;br /&gt;5. You can download MySQL Workbench for Mac OS X from &lt;a href="http://dev.mysql.com/downloads/workbench/5.2.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://cache.facilelogin.com/workbench.png" /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-6245849997378831337?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/6245849997378831337/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=6245849997378831337' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6245849997378831337'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/6245849997378831337'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/installing-mysql-community-server-and.html' title='Installing MySQL Community Server and related tools in Apple Mac OS X'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-7673748771621976472</id><published>2010-12-06T04:26:00.000+05:30</published><updated>2010-12-06T04:26:50.164+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SVN'/><title type='text'>Reverting selected adds in SVN</title><content type='html'>I've been used to the TortoiseSVN client for years now and it gave me everything I needed in a nice UI. Recently I moved to Mac OS X and now getting used to the SVN command line client.&lt;br /&gt;&lt;br /&gt;I by mistake today did an svn add from the root folder - which added all .java as well as .class files.&lt;br /&gt;&lt;br /&gt;I could do an svn revert easily, but that will revert the changes I did for existing files as well - which I do not want to happen.&lt;br /&gt;&lt;br /&gt;So - following is the one I came up with and works really handy - and thought of sharing.&lt;br /&gt;&lt;br /&gt;From the root folder...&lt;pre name="code" class="html"&gt;$ find . -name '*.class' | xargs svn revert&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-7673748771621976472?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/7673748771621976472/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=7673748771621976472' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7673748771621976472'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7673748771621976472'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/reverting-selected-adds-in-svn.html' title='Reverting selected adds in SVN'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-7263046132547869317</id><published>2010-12-05T12:02:00.001+05:30</published><updated>2010-12-05T12:04:18.443+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>Shell script for bulk signing</title><content type='html'>We at WSO2 most of the time release many products at once. With the binary distribution + source distribution + docs - amounts to a large number distributions.&lt;br /&gt;&lt;br /&gt;And signing and generating MD5 and SHA1 for all those is a painful task.&lt;br /&gt;&lt;br /&gt;Following script makes it easy - copy all the distributions to a single directory and copy the following script to the same directory as sign.sh and execute it as,&lt;br /&gt;&lt;br /&gt;$ sh sign.sh prabath&lt;br /&gt;&lt;br /&gt;Here, prabath is the alias of the GPG public key.&lt;br /&gt;&lt;br /&gt;The following script will generate ASC,MD5 and SHA1 of all the distributions and will also dump the public key to KEYS file.&lt;br /&gt;&lt;br /&gt;You should have installed GPG and &lt;a href="http://www.apache.org/dev/release-signing.html"&gt;configured&lt;/a&gt; it before running the script.&lt;pre name="code" class="html"&gt;#!/bin/sh&lt;br /&gt;rm *.asc&lt;br /&gt;rm *.md5&lt;br /&gt;rm *.sha1&lt;br /&gt;rm KEYS&lt;br /&gt;for f0 in  *.zip&lt;br /&gt; do&lt;br /&gt;  echo $f0&lt;br /&gt;  asc=".asc"&lt;br /&gt;  md5=".md5"&lt;br /&gt;  sha1=".sha1"&lt;br /&gt;  f1=$f0$asc&lt;br /&gt;  gpg --armor --output $f1 --detach-sig $f0&lt;br /&gt;  f2=$f0$md5&lt;br /&gt;  gpg --print-md MD5 $f0  &gt; $f2&lt;br /&gt;  f3=$f0$sha1&lt;br /&gt;  gpg --print-md SHA1 $f0  &gt; $f3&lt;br /&gt; done&lt;br /&gt;gpg --armor --export $1 &gt; KEYS&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-7263046132547869317?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/7263046132547869317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=7263046132547869317' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7263046132547869317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7263046132547869317'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/shell-script-for-bulk-signing.html' title='Shell script for bulk signing'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-3250472236378719265</id><published>2010-12-05T10:37:00.002+05:30</published><updated>2010-12-05T10:38:41.154+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>How to debug a shell script ?</title><content type='html'>Simple but very useful..&lt;br /&gt;&lt;br /&gt;$ &lt;b&gt;bash -xv wso2server.sh&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-3250472236378719265?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/3250472236378719265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=3250472236378719265' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3250472236378719265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3250472236378719265'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/how-to-debug-shell-script.html' title='How to debug a shell script ?'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-2686825585935787039</id><published>2010-12-04T14:09:00.011+05:30</published><updated>2011-10-28T13:34:12.631+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kerberos'/><category scheme='http://www.blogger.com/atom/ns#' term='ESB'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Invoking a WCF service secured with Kerberos via WSO2 ESB</title><content type='html'>1. Set up WCF service secured with Kerberos - explained in &lt;a href="http://blog.facilelogin.com/2010/12/kerberos-authentication-with-wcf.html"&gt;this&lt;/a&gt; blog post.&lt;br /&gt;&lt;br /&gt;2. Set up the WSO2 ESB to work with Kerberos - explained in &lt;a href="http://blog.facilelogin.com/2010/12/kerberos-authentication-with-wso2-esb.html"&gt;this&lt;/a&gt; blog post - follow the steps 0,1,2,3 and 4.&lt;br /&gt;&lt;br /&gt;3. Create a resource in the WSO2 ESB - embedded registry with the following content - this is the security policy we will be applying to the out going messages from the ESB to the WCF service.&lt;br /&gt;&lt;br /&gt;In this example, I created a Resource Collection called 'policies' under /_system/governance and created a Resource called krbpolicy with the following content under /_system/governance/policies.&lt;br /&gt;&lt;br /&gt;So, my security policy from the registry is /_system/governance/policies/krbpolicy&lt;pre name="code" class="html"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;wsp:Policy wsu:Id=&amp;quot;kerberossignandencrypt&amp;quot;&lt;br /&gt; xmlns:wsp=&amp;quot;http://schemas.xmlsoap.org/ws/2004/09/policy&amp;quot;&lt;br /&gt; xmlns:wsu=&amp;quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;wsp:ExactlyOne&amp;gt;&lt;br /&gt;  &amp;lt;wsp:All&amp;gt;&lt;br /&gt;   &amp;lt;sp:SymmetricBinding&lt;br /&gt;    xmlns:sp=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;     &amp;lt;sp:ProtectionToken&amp;gt;&lt;br /&gt;      &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;       &amp;lt;sp:KerberosToken&lt;br /&gt;        sp:IncludeToken=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;         &amp;lt;sp:WssKerberosV5ApReqToken11 /&amp;gt;&lt;br /&gt;        &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;       &amp;lt;/sp:KerberosToken&amp;gt;&lt;br /&gt;      &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;     &amp;lt;/sp:ProtectionToken&amp;gt;&lt;br /&gt;     &amp;lt;sp:AlgorithmSuite&amp;gt;&lt;br /&gt;      &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;       &amp;lt;sp:Basic256 /&amp;gt;&lt;br /&gt;      &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;     &amp;lt;/sp:AlgorithmSuite&amp;gt;&lt;br /&gt;     &amp;lt;sp:Layout&amp;gt;&lt;br /&gt;      &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;       &amp;lt;sp:Lax /&amp;gt;&lt;br /&gt;      &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;     &amp;lt;/sp:Layout&amp;gt;&lt;br /&gt;     &amp;lt;sp:IncludeTimestamp /&amp;gt;&lt;br /&gt;     &amp;lt;sp:OnlySignEntireHeadersAndBody /&amp;gt;&lt;br /&gt;    &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;   &amp;lt;/sp:SymmetricBinding&amp;gt;&lt;br /&gt;   &amp;lt;sp:SignedParts&lt;br /&gt;    xmlns:sp=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;sp:Body /&amp;gt;&lt;br /&gt;   &amp;lt;/sp:SignedParts&amp;gt;&lt;br /&gt;   &amp;lt;sp:Wss11 xmlns:sp=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;sp:Policy&amp;gt;&lt;br /&gt;     &amp;lt;sp:MustSupportRefKeyIdentifier /&amp;gt;&lt;br /&gt;     &amp;lt;sp:MustSupportRefIssuerSerial /&amp;gt;&lt;br /&gt;     &amp;lt;sp:MustSupportRefThumbprint /&amp;gt;&lt;br /&gt;     &amp;lt;sp:RequireSignatureConfirmation /&amp;gt;&lt;br /&gt;    &amp;lt;/sp:Policy&amp;gt;&lt;br /&gt;   &amp;lt;/sp:Wss11&amp;gt;&lt;br /&gt;   &amp;lt;sp:Trust10 xmlns:sp=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;     &amp;lt;sp:RequireClientEntropy /&amp;gt;&lt;br /&gt;     &amp;lt;sp:RequireServerEntropy /&amp;gt;&lt;br /&gt;     &amp;lt;sp:MustSupportIssuedTokens /&amp;gt;&lt;br /&gt;    &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;   &amp;lt;/sp:Trust10&amp;gt;&lt;br /&gt;   &amp;lt;rampart:RampartConfig xmlns:rampart=&amp;quot;http://ws.apache.org/rampart/policy&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;rampart:timestampPrecisionInMilliseconds&amp;gt;true&lt;br /&gt;    &amp;lt;/rampart:timestampPrecisionInMilliseconds&amp;gt;&lt;br /&gt;    &amp;lt;rampart:timestampTTL&amp;gt;300&amp;lt;/rampart:timestampTTL&amp;gt;&lt;br /&gt;    &amp;lt;rampart:timestampMaxSkew&amp;gt;300&amp;lt;/rampart:timestampMaxSkew&amp;gt;&lt;br /&gt;    &amp;lt;rampart:kerberosConfig&amp;gt;&lt;br /&gt;     &amp;lt;rampart:property name=&amp;quot;client.principal.name&amp;quot;&amp;gt;client&amp;lt;/rampart:property&amp;gt;&lt;br /&gt;     &amp;lt;rampart:property name=&amp;quot;client.principal.password&amp;quot;&amp;gt;1qaz2wsx$&lt;br /&gt;     &amp;lt;/rampart:property&amp;gt;&lt;br /&gt;     &amp;lt;rampart:property name=&amp;quot;service.principal.name&amp;quot;&amp;gt;service/myserver@WSO2.COM&lt;br /&gt;     &amp;lt;/rampart:property&amp;gt;&lt;br /&gt;     &amp;lt;rampart:property name=&amp;quot;java.security.auth.login.config&amp;quot;&amp;gt;jaas.conf&lt;br /&gt;     &amp;lt;/rampart:property&amp;gt;&lt;br /&gt;     &amp;lt;rampart:property name=&amp;quot;javax.security.auth.useSubjectCredsOnly&amp;quot;&amp;gt;true&amp;lt;/rampart:property&amp;gt;&lt;br /&gt;     &amp;lt;rampart:property name=&amp;quot;kdc.des.aes.factor&amp;quot;&amp;gt;4&amp;lt;/rampart:property&amp;gt;&lt;br /&gt;     &amp;lt;rampart:property name=&amp;quot;java.security.krb5.conf&amp;quot;&amp;gt;/Users/prabath/clients/wso2esb-3.0.1/repository/conf/krb.conf&lt;br /&gt;     &amp;lt;/rampart:property&amp;gt;&lt;br /&gt;    &amp;lt;/rampart:kerberosConfig&amp;gt;&lt;br /&gt;   &amp;lt;/rampart:RampartConfig&amp;gt;&lt;br /&gt;  &amp;lt;/wsp:All&amp;gt;&lt;br /&gt; &amp;lt;/wsp:ExactlyOne&amp;gt;&lt;br /&gt;&amp;lt;/wsp:Policy&amp;gt;&lt;/pre&gt;In the policy we have to set the absolute path to the krb.conf - at the same time we need to set the username and password of the client who invokes the WCF service appropriately - and this account should be in the Active Directory.&lt;br /&gt;&lt;br /&gt;4. Now create a proxy service - and in the InSequence - in the Endpoint pointing to the WCF service, enable security and pick the security policy we set before, from the registry.&lt;br /&gt;&lt;br /&gt;The endpoint configuration in the synapse config will look like,&lt;pre name="code" class="html"&gt;&amp;lt;endpoint name=&amp;quot;endpoint_urn_uuid_81768417D4430798591291451112900558002-585115135&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;address uri=&amp;quot;http://192.168.2.13/EchoServices/EchoService.svc&amp;quot;&amp;gt;&lt;br /&gt;                    &amp;lt;enableSec policy=&amp;quot;gov:/policies/krbpolicy&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;/address&amp;gt;&lt;br /&gt;&amp;lt;/endpoint&amp;gt;&lt;/pre&gt;5. Also in the InSequence we need to add a Property mediator and set the following.&lt;pre name="code" class="html"&gt;&amp;lt;property name=&amp;quot;PRESERVE_WS_ADDRESSING&amp;quot; value=&amp;quot;true&amp;quot;/&amp;gt;&lt;/pre&gt;6. Now in the OutSequence - we need to remove the Security Header coming from the WCF service before the Send mediator in the OutSequence - you can do it with a Header mediator.&lt;br /&gt;&lt;pre name="code" class="html"&gt;&amp;lt;header xmlns:wsse=&amp;quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&amp;quot; name=&amp;quot;wsse:Security&amp;quot; action=&amp;quot;remove&amp;quot;/&amp;gt;&lt;/pre&gt;7. Also in the OutSequence we need to add a Property mediator and set the following.&lt;pre name="code" class="html"&gt;&amp;lt;property name=&amp;quot;disableAddressingForOutMessages&amp;quot; value=&amp;quot;true&amp;quot; scope=&amp;quot;axis2&amp;quot;/&amp;gt;&lt;br /&gt;&lt;/pre&gt;These two properties [5 &amp; 7] are needed if the back end service is WCF and it is secured using WS-Security and ESB is acting as a passthrough. When communicating with WCF, wsa:to should point to WCF service endpoint (In axis2, it can can point to some other place, still axis2 will dispatch correctly using URL). For the pass through with security case, client should  sign wsa:headers (WS-Security requirement) and hence wsa:to cannot be changed by ESB (violation of signature); Hence, the requirement for "preserve addressing". When the response comes from WCF-&gt;ESB, ESB adds addressing header regardless of whether the original message (from WCF) has addressing or not. In above case, since wsa:headers of request is signed by client, response from WCF will contain a signed wsa headers. If ESB adds one more set of addressing headers, then it will be violating protocol. Hence the requirement for "disable addressing for out messages"&lt;br /&gt;&lt;br /&gt;8. Now your InSquence will like, &lt;pre name="code" class="html"&gt;&amp;lt;inSequence&amp;gt;&lt;br /&gt;                &amp;lt;property name=&amp;quot;PRESERVE_WS_ADDRESSING&amp;quot; value=&amp;quot;true&amp;quot; scope=&amp;quot;default&amp;quot; type=&amp;quot;STRING&amp;quot;/&amp;gt;&lt;br /&gt;            &amp;lt;/inSequence&amp;gt;&lt;br /&gt;&lt;/pre&gt;9. OutSequence will look like,&lt;pre name="code" class="html"&gt;&amp;lt;outSequence&amp;gt;&lt;br /&gt;                &amp;lt;property name=&amp;quot;disableAddressingForOutMessages&amp;quot; value=&amp;quot;true&amp;quot; scope=&amp;quot;axis2&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;header xmlns:wsse=&amp;quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd&amp;quot; name=&amp;quot;wsse:Security&amp;quot; action=&amp;quot;remove&amp;quot;/&amp;gt;&lt;br /&gt;                &amp;lt;send/&amp;gt;&lt;br /&gt;            &amp;lt;/outSequence&amp;gt;&lt;br /&gt;&lt;/pre&gt;10. That's it :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-2686825585935787039?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/2686825585935787039/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=2686825585935787039' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2686825585935787039'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2686825585935787039'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/invoking-wcf-service-secured-with.html' title='Invoking a WCF service secured with Kerberos via WSO2 ESB'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-5940266488097457508</id><published>2010-12-04T13:19:00.004+05:30</published><updated>2010-12-04T15:57:13.097+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kerberos'/><category scheme='http://www.blogger.com/atom/ns#' term='WSO2'/><category scheme='http://www.blogger.com/atom/ns#' term='ESB'/><title type='text'>Kerberos authentication with WSO2 ESB</title><content type='html'>0. Set up the Active Directory as the KDC as in my &lt;a href="http://blog.facilelogin.com/2010/12/kerberos-authentication-with-wcf.html"&gt;previous&lt;/a&gt; blog post.&lt;br /&gt;&lt;br /&gt;1. Download WSO2 ESB 3.0.1 from here unzip and apply the patches patch0003 and patch0023.These patches are not publicly available - but will be added in to the future releases. If you interested, please contact us on bizdev@wso2.com.&lt;br /&gt;&lt;br /&gt;2. Create a file called krb.conf inside [ESB_HOME]\repository\conf and copy the following content to it.&lt;pre name="code" class="html"&gt;[libdefaults] &lt;br /&gt;        default_realm = WSO2.COM &lt;br /&gt;        default_tkt_enctypes = rc4-hmac &lt;br /&gt;        default_tgs_enctypes = rc4-hmac &lt;br /&gt;        dns_lookup_kdc = true &lt;br /&gt;        dns_lookup_realm = false &lt;br /&gt;&lt;br /&gt;[realms] &lt;br /&gt;        WSO2.COM = { &lt;br /&gt;            kdc = 192.168.2.10&lt;br /&gt;   } &lt;br /&gt;&lt;/pre&gt;Here, WSO2.COM is my root domain name of my Active Directory, which is acting as the KDC and 192.168.2.1 is it's IP address - so you need to change them as per your setup. Make sure that you have default_realm all caps.&lt;br /&gt;&lt;br /&gt;3. Create a file called jaas.conf inside [ESB_HOME]\repository\conf and copy the following content to it.&lt;pre name="code" class="html"&gt;Server {&lt;br /&gt;com.sun.security.auth.module.Krb5LoginModule required&lt;br /&gt;useKeyTab=tfalse&lt;br /&gt;storeKey=true&lt;br /&gt;useTicketCache=false&lt;br /&gt;isInitiator=false;&lt;br /&gt;};&lt;br /&gt;Client {&lt;br /&gt;com.sun.security.auth.module.Krb5LoginModule required&lt;br /&gt;useTicketCache=false;&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;4. Start the WSO2 ESB&lt;br /&gt;&lt;br /&gt;5. Apply security to the given proxy service [during this sample we select echo sample service which is already there by default]&lt;br /&gt;&lt;br /&gt;6. Select 'Sign &amp; Encrypt with Anonymous' from the Security Policy wizard.&lt;br /&gt;&lt;br /&gt;7. After applying, edit the policy and replace both bindings with the content below.&lt;pre name="code" class="html"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;wsp:Policy wsu:Id=&amp;quot;kerberossignandencrypt&amp;quot;&lt;br /&gt;  xmlns:wsp=&amp;quot;http://schemas.xmlsoap.org/ws/2004/09/policy&amp;quot; xmlns:wsu=&amp;quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&amp;quot;&amp;gt;&lt;br /&gt;  &amp;lt;wsp:ExactlyOne&amp;gt;&lt;br /&gt;    &amp;lt;wsp:All&amp;gt;&lt;br /&gt;      &amp;lt;sp:SymmetricBinding xmlns:sp=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;          &amp;lt;sp:ProtectionToken&amp;gt;&lt;br /&gt;            &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;              &amp;lt;sp:KerberosToken sp:IncludeToken=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient&amp;quot;&amp;gt;&lt;br /&gt;                &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;                  &amp;lt;sp:WssKerberosV5ApReqToken11/&amp;gt;&lt;br /&gt;                &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;              &amp;lt;/sp:KerberosToken&amp;gt;&lt;br /&gt;            &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;          &amp;lt;/sp:ProtectionToken&amp;gt;&lt;br /&gt;          &amp;lt;sp:AlgorithmSuite&amp;gt;&lt;br /&gt;            &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;              &amp;lt;sp:Basic256/&amp;gt;&lt;br /&gt;            &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;          &amp;lt;/sp:AlgorithmSuite&amp;gt;&lt;br /&gt;          &amp;lt;sp:Layout&amp;gt;&lt;br /&gt;            &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;              &amp;lt;sp:Lax/&amp;gt;&lt;br /&gt;            &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;          &amp;lt;/sp:Layout&amp;gt;&lt;br /&gt;          &amp;lt;sp:IncludeTimestamp/&amp;gt;&lt;br /&gt;          &amp;lt;sp:OnlySignEntireHeadersAndBody/&amp;gt;&lt;br /&gt;        &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;      &amp;lt;/sp:SymmetricBinding&amp;gt;&lt;br /&gt;      &amp;lt;sp:SignedParts xmlns:sp=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;sp:Body/&amp;gt;&lt;br /&gt;      &amp;lt;/sp:SignedParts&amp;gt;&lt;br /&gt;      &amp;lt;sp:Wss11 xmlns:sp=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;sp:Policy&amp;gt;&lt;br /&gt;          &amp;lt;sp:MustSupportRefKeyIdentifier/&amp;gt;&lt;br /&gt;          &amp;lt;sp:MustSupportRefIssuerSerial/&amp;gt;&lt;br /&gt;          &amp;lt;sp:MustSupportRefThumbprint/&amp;gt;&lt;br /&gt;          &amp;lt;sp:RequireSignatureConfirmation/&amp;gt;&lt;br /&gt;        &amp;lt;/sp:Policy&amp;gt;&lt;br /&gt;      &amp;lt;/sp:Wss11&amp;gt;&lt;br /&gt;      &amp;lt;sp:Trust10 xmlns:sp=&amp;quot;http://schemas.xmlsoap.org/ws/2005/07/securitypolicy&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;wsp:Policy&amp;gt;&lt;br /&gt;          &amp;lt;sp:RequireClientEntropy/&amp;gt;&lt;br /&gt;          &amp;lt;sp:RequireServerEntropy/&amp;gt;&lt;br /&gt;          &amp;lt;sp:MustSupportIssuedTokens/&amp;gt;&lt;br /&gt;        &amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;      &amp;lt;/sp:Trust10&amp;gt;&lt;br /&gt;      &amp;lt;rampart:RampartConfig xmlns:rampart=&amp;quot;http://ws.apache.org/rampart/policy&amp;quot;&amp;gt;&lt;br /&gt;        &amp;lt;rampart:timestampPrecisionInMilliseconds&amp;gt;true&amp;lt;/rampart:timestampPrecisionInMilliseconds&amp;gt;&lt;br /&gt;        &amp;lt;rampart:timestampTTL&amp;gt;300&amp;lt;/rampart:timestampTTL&amp;gt;&lt;br /&gt;        &amp;lt;rampart:timestampMaxSkew&amp;gt;300&amp;lt;/rampart:timestampMaxSkew&amp;gt;&lt;br /&gt;        &amp;lt;rampart:kerberosConfig&amp;gt;&lt;br /&gt;          &amp;lt;rampart:property name=&amp;quot;service.principal.password&amp;quot;&amp;gt;1qaz2wsx$&amp;lt;/rampart:property&amp;gt;&lt;br /&gt;          &amp;lt;rampart:property name=&amp;quot;javax.security.auth.useSubjectCredsOnly&amp;quot;&amp;gt;true&amp;lt;/rampart:property&amp;gt;&lt;br /&gt;          &amp;lt;rampart:property name=&amp;quot;java.security.krb5.conf&amp;quot;&amp;gt;/Users/prabath/clients/wso2esb-3.0.1/repository/conf/krb.conf&amp;lt;/rampart:property&amp;gt; &lt;br /&gt;       &amp;lt;/rampart:kerberosConfig&amp;gt;&lt;br /&gt;      &amp;lt;/rampart:RampartConfig&amp;gt;&lt;br /&gt;    &amp;lt;/wsp:All&amp;gt;&lt;br /&gt;  &amp;lt;/wsp:ExactlyOne&amp;gt;&lt;br /&gt;&amp;lt;/wsp:Policy&amp;gt;&lt;br /&gt;&lt;/pre&gt;You need to set your SPN password under &lt;b&gt;service.principal.password&lt;/b&gt; and also the absolute path to krb.conf under java.security.krb5.conf.&lt;br /&gt;&lt;br /&gt;8. You can write the Java client to this service as explained in my &lt;a href="http://blog.facilelogin.com/2010/12/kerberos-authentication-with-wcf_04.html"&gt;previous&lt;/a&gt; blog post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-5940266488097457508?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/5940266488097457508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=5940266488097457508' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5940266488097457508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5940266488097457508'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/kerberos-authentication-with-wso2-esb.html' title='Kerberos authentication with WSO2 ESB'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-2262639745890674513</id><published>2010-12-04T12:34:00.004+05:30</published><updated>2010-12-04T12:58:10.406+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kerberos'/><title type='text'>Kerberos authentication with WCF Service and Java Client</title><content type='html'>1. Go through &lt;a href="http://blog.facilelogin.com/2010/12/kerberos-authentication-with-wcf.html"&gt;this&lt;/a&gt; previous post and get the WCF Service running properly with the Kerberos authentication.&lt;br /&gt;&lt;br /&gt;2. Download the Kerberos java client Eclipse project from &lt;a href="http://cache.facilelogin.com/org.wso2.identity.esb.kerberos.zip"&gt;here&lt;/a&gt; - import it in to an Eclipse workspace and fix the missing references - all the jars available inside [WSO2_ESB_HOME]\repository\components\plugin. You can download WSO2 ESB 3.0.1 from &lt;a href="http://wso2.org/downloads/esb"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;3. rampart-core, rampart-policy and wss4j should be picked from patch0003 and patch0023. These patches are not publicly available - but will be added in to the future releases. If you interested, please contact us on bizdev@wso2.com.&lt;br /&gt;&lt;br /&gt;4.Make sure the Eclipse project compiles.&lt;br /&gt;&lt;br /&gt;5. Configuration files&lt;br /&gt;&lt;br /&gt;5.1. &lt;b&gt;krb.conf&lt;/b&gt;&lt;pre name="code" class="html"&gt;[libdefaults] &lt;br /&gt;        default_realm = WSO2.COM &lt;br /&gt;        default_tkt_enctypes = rc4-hmac &lt;br /&gt;        default_tgs_enctypes = rc4-hmac &lt;br /&gt;        dns_lookup_kdc = true &lt;br /&gt;        dns_lookup_realm = false &lt;br /&gt;&lt;br /&gt;[realms] &lt;br /&gt;        WSO2.COM = { &lt;br /&gt;            kdc = 192.168.2.10&lt;br /&gt;   } &lt;br /&gt;&lt;/pre&gt;Here, WSO2.COM is my root domain name of my Active Directory, which is acting as the KDC and 192.168.2.1 is it's IP address - so you need to change them as per your setup. Make sure that you have default_realm all caps.&lt;br /&gt;&lt;br /&gt;5.2  &lt;b&gt;jaas.conf&lt;/b&gt;&lt;pre name="code" class="html"&gt;Client {&lt;br /&gt;com.sun.security.auth.module.Krb5LoginModule required&lt;br /&gt;useTicketCache=false;&lt;br /&gt;};&lt;br /&gt;&lt;/pre&gt;You must have this Client section. Here we set useTicketCache=false; so our java client need not to be running from the same Windows domain as the KDC. If you set to true, you need to be in the same Windows domain as the KDC and also edit the Windows registry at the client end - my &lt;a href="http://blog.facilelogin.com/2010/11/kerberos-debugging-tips.html"&gt;previous&lt;/a&gt; blog post explains how to do that - see #6.&lt;br /&gt;&lt;br /&gt;5.3 &lt;b&gt;policy-1.xml&lt;/b&gt;&lt;pre name="code" class="html"&gt;&amp;lt;rampart:kerberosConfig&amp;gt;&lt;br /&gt;     &amp;lt;rampart:property name=&amp;quot;client.principal.name&amp;quot;&amp;gt;client&amp;lt;/rampart:property&amp;gt;&lt;br /&gt;     &amp;lt;rampart:property name=&amp;quot;client.principal.password&amp;quot;&amp;gt;1qaz2wsx$&lt;br /&gt;     &amp;lt;/rampart:property&amp;gt;&lt;br /&gt;     &amp;lt;rampart:property name=&amp;quot;service.principal.name&amp;quot;&amp;gt;service/myserver@WSO2.COM&lt;br /&gt;     &amp;lt;/rampart:property&amp;gt;&lt;br /&gt;     &amp;lt;rampart:property name=&amp;quot;java.security.auth.login.config&amp;quot;&amp;gt;jaas.conf&lt;br /&gt;     &amp;lt;/rampart:property&amp;gt;&lt;br /&gt;     &amp;lt;rampart:property name=&amp;quot;javax.security.auth.useSubjectCredsOnly&amp;quot;&amp;gt;true&amp;lt;/rampart:property&amp;gt;&lt;br /&gt;     &amp;lt;rampart:property name=&amp;quot;kdc.des.aes.factor&amp;quot;&amp;gt;4&amp;lt;/rampart:property&amp;gt;&lt;br /&gt;     &amp;lt;rampart:property name=&amp;quot;java.security.krb5.conf&amp;quot;&amp;gt;/Users/prabath/clients/org.wso2.identity.esb.kerberos/krb.conf&lt;br /&gt;     &amp;lt;/rampart:property&amp;gt;&lt;br /&gt;    &amp;lt;/rampart:kerberosConfig&amp;gt;&lt;/pre&gt;This is the security policy of the client and we have to set the path to jaas.conf and the absolute path to the krb.conf - at the same time we need to set the username and password of the client who invokes this - and this account should be in the Active Directory.&lt;br /&gt;&lt;br /&gt;Also make a note of, service.principal.name - this is the SPN of the account where the Kerberos service is running under - we set this up in my &lt;a href="http://blog.facilelogin.com/2010/12/kerberos-authentication-with-wcf.html"&gt;previous&lt;/a&gt; blog post&lt;br /&gt;&lt;br /&gt;6. In the KerberosCLient code set the RELYING_PARTY_SERVICE_EPR to you WCF Service EPR http://192.168.2.10/EchoServices/EchoService.svc&lt;br /&gt;&lt;br /&gt;7. That's it :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-2262639745890674513?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/2262639745890674513/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=2262639745890674513' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2262639745890674513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2262639745890674513'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/kerberos-authentication-with-wcf_04.html' title='Kerberos authentication with WCF Service and Java Client'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-7289804314582290791</id><published>2010-12-04T00:13:00.006+05:30</published><updated>2010-12-04T12:41:29.157+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kerberos'/><category scheme='http://www.blogger.com/atom/ns#' term='WCF'/><title type='text'>Kerberos authentication with WCF Service and WCF Client</title><content type='html'>1.&lt;b&gt;Environment Setup&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;- Required Windows 2008 Server + IIS 7 + Active Directory + Visual Studio 2008 &lt;br /&gt;&lt;br /&gt;1.1 Active Directory&lt;br /&gt;&lt;br /&gt;Following image shows my Active Directory configuration which includes two users server and client&lt;br /&gt;&lt;br /&gt;&lt;img src="http://farm6.static.flickr.com/5006/5229684132_fd67ba9b72_z.jpg" width="640" height="399"  /&gt;&lt;br /&gt;&lt;br /&gt;Open up a command window and type the following to set the SPN for the user 'server'&lt;pre name="code" class="html"&gt;:\&gt; setspn -A service/myserver server&lt;/pre&gt;&lt;br /&gt;1.2 IIS&lt;br /&gt;&lt;br /&gt;Open up IIS and create an application pool called 'kerberos'&lt;br /&gt;&lt;br /&gt;&lt;img src="http://farm6.static.flickr.com/5126/5229083581_4e969275e6.jpg" width="500" height="472" /&gt;&lt;br /&gt;&lt;br /&gt;Then Edit the Advance Settings of the created application pool --&gt; Select 'Identity' (under Process Model) --&gt; Select 'Custom Account' --&gt; set the user 'server' and his password &lt;br /&gt;&lt;br /&gt;&lt;img src="http://farm6.static.flickr.com/5126/5229083585_cc421fe9df.jpg" width="500" height="343" /&gt;&lt;br /&gt;&lt;br /&gt;2.&lt;b&gt;Sample Setup&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;2.1 Download the sample zip file from &lt;a href="http://cache.facilelogin.com/EchoWcfClientService2008.zip"&gt;here&lt;/a&gt;, unzip and open it up in Visual Studio 2008&lt;br /&gt;&lt;br /&gt;2.2 Find the following setting in web.config unser EchoService project and change it appropriately.. Here service/myserver is the SPN you create before for the user server.&lt;pre name="code" class="html"&gt;&amp;lt;identity&gt; &lt;br /&gt;&amp;lt;serviceprincipalname value="service/myserver" /&gt; &lt;br /&gt;&amp;lt;/identity&gt; &lt;/pre&gt;2.3 Build the entire solution &lt;br /&gt;&lt;br /&gt;2.4 Deploy the service in IIS with the EchoService.WebSetup project &lt;br /&gt;&lt;br /&gt;2.5 While doing 2.4, select the application pool created before in IIS - that is 'Kerberos' &lt;br /&gt;&lt;br /&gt;2.6 Make sure the service running properly by accessing it's WSDL &lt;br /&gt;&lt;br /&gt;http://localhost/EchoServices/EchoService.svc?wsdl&lt;br /&gt;&lt;br /&gt;2.7 Open up the app.config file under EchoClient project and edit the following configuration appropriately..&lt;pre name="code" class="html"&gt;&amp;lt;identity&gt; &lt;br /&gt;&amp;lt;serviceprincipalname value="service/myserver" /&gt; &lt;br /&gt;&amp;lt;/identity&gt; &lt;/pre&gt;2.8 Correct the End Point address in app.config to point to the deployed service &lt;br /&gt;&lt;br /&gt;That's it - now you can run the client from the IDE by setting it as the startup project.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-7289804314582290791?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/7289804314582290791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=7289804314582290791' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7289804314582290791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7289804314582290791'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/kerberos-authentication-with-wcf.html' title='Kerberos authentication with WCF Service and WCF Client'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://farm6.static.flickr.com/5006/5229684132_fd67ba9b72_t.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-1742216601211222136</id><published>2010-12-03T01:45:00.004+05:30</published><updated>2010-12-03T01:48:54.545+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><title type='text'>How to fetch HTTPS end point certificate chain via Shell ?</title><content type='html'>You can do it through the web browser - and download each and every certificate...&lt;br /&gt;&lt;br /&gt;Following is the easy way via shell..&lt;pre name="code" class="html"&gt;$ openssl s_client -showcerts  -connect www.amazon.com:443 &gt; ssl.log&lt;br /&gt;&lt;br /&gt;depth=1 C = US, O = "VeriSign, Inc.", OU = VeriSign Trust Network, OU = Terms of use at https://www.verisign.com/rpa (c)09, CN = VeriSign Class 3 Secure Server CA - G2&lt;br /&gt;verify error:num=20:unable to get local issuer certificate&lt;br /&gt;verify return:0&lt;br /&gt;&lt;br /&gt;CtrL+C&lt;br /&gt;&lt;br /&gt;$ sed -n  '/-----BEGIN CERTIFICATE-----/,/-----END CERTIFICATE-----/p' ssl.log  &gt; cert.pem&lt;br /&gt;&lt;/pre&gt;The above will save the certificate chain corresponding to www.amazon.com in cert.pem file.&lt;pre name="code" class="html"&gt;-----BEGIN CERTIFICATE-----&lt;br /&gt;MIIE9jCCA96gAwIBAgIQJfXRLV5vC9Tq8qLJZvO0zjANBgkqhkiG9w0BAQUFADCB&lt;br /&gt;tTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL&lt;br /&gt;ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTswOQYDVQQLEzJUZXJtcyBvZiB1c2Ug&lt;br /&gt;YXQgaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JwYSAoYykwOTEvMC0GA1UEAxMm&lt;br /&gt;VmVyaVNpZ24gQ2xhc3MgMyBTZWN1cmUgU2VydmVyIENBIC0gRzIwHhcNMTAwNzE1&lt;br /&gt;MDAwMDAwWhcNMTMwNzE0MjM1OTU5WjBnMQswCQYDVQQGEwJVUzETMBEGA1UECBMK&lt;br /&gt;V2FzaGluZ3RvbjEQMA4GA1UEBxQHU2VhdHRsZTEYMBYGA1UEChQPQW1hem9uLmNv&lt;br /&gt;bSBJbmMuMRcwFQYDVQQDFA53d3cuYW1hem9uLmNvbTCBnzANBgkqhkiG9w0BAQEF&lt;br /&gt;AAOBjQAwgYkCgYEAvokOoa36fVhqoWrkO+115D7yGffzD/rZ72IQUnv83ZSWqDVr&lt;br /&gt;G1BgLi55rHwuo4HejTf57m5PgsfkEgRVr1dplIzvLlB6bVMPW19iWF7P8t/0Tc5x&lt;br /&gt;toLXhuVPd+SRquS9WmWqniBPOF60i+A2RYCo1SRcRp3xgMBrYqUfJl6uF0cCAwEA&lt;br /&gt;AaOCAdEwggHNMAkGA1UdEwQCMAAwCwYDVR0PBAQDAgWgMEUGA1UdHwQ+MDwwOqA4&lt;br /&gt;oDaGNGh0dHA6Ly9TVlJTZWN1cmUtRzItY3JsLnZlcmlzaWduLmNvbS9TVlJTZWN1&lt;br /&gt;cmVHMi5jcmwwRAYDVR0gBD0wOzA5BgtghkgBhvhFAQcXAzAqMCgGCCsGAQUFBwIB&lt;br /&gt;FhxodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhMB0GA1UdJQQWMBQGCCsGAQUF&lt;br /&gt;BwMBBggrBgEFBQcDAjAfBgNVHSMEGDAWgBSl7wsRzsBBA6NKZZBIshzgVy19RzB2&lt;br /&gt;BggrBgEFBQcBAQRqMGgwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLnZlcmlzaWdu&lt;br /&gt;LmNvbTBABggrBgEFBQcwAoY0aHR0cDovL1NWUlNlY3VyZS1HMi1haWEudmVyaXNp&lt;br /&gt;Z24uY29tL1NWUlNlY3VyZUcyLmNlcjBuBggrBgEFBQcBDARiMGChXqBcMFowWDBW&lt;br /&gt;FglpbWFnZS9naWYwITAfMAcGBSsOAwIaBBRLa7kolgYMu9BSOJsprEsHiyEFGDAm&lt;br /&gt;FiRodHRwOi8vbG9nby52ZXJpc2lnbi5jb20vdnNsb2dvMS5naWYwDQYJKoZIhvcN&lt;br /&gt;AQEFBQADggEBAKgV/fW6WoiZDCo9KLt0gmU/QkchH9R41k2etuwXzRi3nvmD5ek5&lt;br /&gt;io/dPGHXwOvxcjTkTz/nM0CpSZ9EsI2/M7F2laNQIY+PDB5ggl4gmPq/GTMaEqFh&lt;br /&gt;YT+oXLiAmqA03N1SjJiFum3OvOBMqZs4xU1WELrvcoobCGh73VlD5TMbCj+9QyrL&lt;br /&gt;7jQ2Q9Vp18p6g6mr5hXvlOiVZSv2nhFOXw4ZAXahMDYGUvEJ4M/UcRYNgLoSJp6T&lt;br /&gt;Sxxfg0ws0Gk7xZkxxEyPJ75JmqwhPkpd4RjTOURiBBbazNjtPYjSpuOub+sTr/Ft&lt;br /&gt;ftICSDU8L5qg9bxV6qR7it5iC3OcWEEcLFE=&lt;br /&gt;-----END CERTIFICATE-----&lt;br /&gt;-----BEGIN CERTIFICATE-----&lt;br /&gt;MIIGLDCCBZWgAwIBAgIQbk/6s8XmacTRZ8mSq+hYxDANBgkqhkiG9w0BAQUFADCB&lt;br /&gt;wTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTwwOgYDVQQL&lt;br /&gt;EzNDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5&lt;br /&gt;IC0gRzIxOjA4BgNVBAsTMShjKSAxOTk4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1&lt;br /&gt;dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv&lt;br /&gt;cmswHhcNMDkwMzI1MDAwMDAwWhcNMTkwMzI0MjM1OTU5WjCBtTELMAkGA1UEBhMC&lt;br /&gt;VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU&lt;br /&gt;cnVzdCBOZXR3b3JrMTswOQYDVQQLEzJUZXJtcyBvZiB1c2UgYXQgaHR0cHM6Ly93&lt;br /&gt;d3cudmVyaXNpZ24uY29tL3JwYSAoYykwOTEvMC0GA1UEAxMmVmVyaVNpZ24gQ2xh&lt;br /&gt;c3MgMyBTZWN1cmUgU2VydmVyIENBIC0gRzIwggEiMA0GCSqGSIb3DQEBAQUAA4IB&lt;br /&gt;DwAwggEKAoIBAQDUVo9XOzcopkBj0pXVBXTatRlqltZxVy/iwDSMoJWzjOE3JPMu&lt;br /&gt;7UNFBY6J1/raSrX4Po1Ox/lJUEU3QJ90qqBRVWHxYISJpZ6AjS+wIapFgsTPtBR/&lt;br /&gt;RxUgKIKwaBLArlwH1/ZZzMtiVlxNSf8miKtUUTovStoOmOKJcrn892g8xB85essX&lt;br /&gt;gfMMrQ/cYWIbEAsEHikYcV5iy0PevjG6cQIZTiapUdqMZGkD3pz9ff17Ybz8hHyI&lt;br /&gt;XLTDe+1fK0YS8f0AAZqLW+mjBS6PLlve8xt4+GaRCMBeztWwNsrUqHugffkwer/4&lt;br /&gt;3RlRKyC6/qfPoU6wZ/WAqiuDLtKOVImOHikLAgMBAAGjggKpMIICpTA0BggrBgEF&lt;br /&gt;BQcBAQQoMCYwJAYIKwYBBQUHMAGGGGh0dHA6Ly9vY3NwLnZlcmlzaWduLmNvbTAS&lt;br /&gt;BgNVHRMBAf8ECDAGAQH/AgEAMHAGA1UdIARpMGcwZQYLYIZIAYb4RQEHFwMwVjAo&lt;br /&gt;BggrBgEFBQcCARYcaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL2NwczAqBggrBgEF&lt;br /&gt;BQcCAjAeGhxodHRwczovL3d3dy52ZXJpc2lnbi5jb20vcnBhMDQGA1UdHwQtMCsw&lt;br /&gt;KaAnoCWGI2h0dHA6Ly9jcmwudmVyaXNpZ24uY29tL3BjYTMtZzIuY3JsMA4GA1Ud&lt;br /&gt;DwEB/wQEAwIBBjBtBggrBgEFBQcBDARhMF+hXaBbMFkwVzBVFglpbWFnZS9naWYw&lt;br /&gt;ITAfMAcGBSsOAwIaBBSP5dMahqyNjmvDz4Bq1EgYLHsZLjAlFiNodHRwOi8vbG9n&lt;br /&gt;by52ZXJpc2lnbi5jb20vdnNsb2dvLmdpZjApBgNVHREEIjAgpB4wHDEaMBgGA1UE&lt;br /&gt;AxMRQ2xhc3MzQ0EyMDQ4LTEtNTIwHQYDVR0OBBYEFKXvCxHOwEEDo0plkEiyHOBX&lt;br /&gt;LX1HMIHnBgNVHSMEgd8wgdyhgcekgcQwgcExCzAJBgNVBAYTAlVTMRcwFQYDVQQK&lt;br /&gt;Ew5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy&lt;br /&gt;eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5&lt;br /&gt;OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYD&lt;br /&gt;VQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrghB92f4Hz6getxB5Z/uniTTGMA0G&lt;br /&gt;CSqGSIb3DQEBBQUAA4GBAGN0Lz1Tqi+X7CYRZhr+8d5BJxnSf9jBHPniOFY6H5Cu&lt;br /&gt;OcUgdav4bC1nHynCIdcUiGNLsJsnY5H48KMBJLb7j+M9AgtvVP7UzNvWhb98lR5e&lt;br /&gt;YhHB2QmcQrmy1KotmDojYMyimvFu6M+O0Ro8XhnF15s1sAIjJOUFuNWI4+D6ufRf&lt;br /&gt;-----END CERTIFICATE-----&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-1742216601211222136?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/1742216601211222136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=1742216601211222136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1742216601211222136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1742216601211222136'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/how-to-fetch-https-end-point.html' title='How to fetch HTTPS end point certificate chain via Shell ?'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-985606344490238659</id><published>2010-12-02T17:23:00.006+05:30</published><updated>2010-12-26T17:59:52.289+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>Curl with HTTPS</title><content type='html'>Wrote a blog sometime back on "How to invoke a web service call with curl ?" in &lt;a href="http://blog.rampartfaq.com/2010/06/how-to-invoke-web-service-call-with.html"&gt;RampartFAQ.com&lt;/a&gt; - but that doesn't explain how to work with Curl with HTTPS.&lt;br /&gt;&lt;br /&gt;Today morning I got a question from one of my colleagues and thought of writing a blog on the $subject in detail..&lt;br /&gt;&lt;br /&gt;Let's go with few examples..&lt;br /&gt;&lt;br /&gt;1. Invoke https://www.amazon.com&lt;pre name="code" class="html"&gt;$ curl https://www.amazon.com&lt;br /&gt;&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//IETF//DTD HTML 2.0//EN&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;301 Moved Permanently&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Moved Permanently&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;The document has moved &amp;lt;a href=&amp;quot;http://www.amazon.com/&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;/pre&gt;2. Above won't print details about the SSL handshake. To view SSL handshake let's use -v as an argument &lt;br /&gt;&lt;pre name="code" class="html"&gt;$ curl -v https://www.amazon.com&lt;br /&gt;* About to connect() to www.amazon.com port 443 (#0)&lt;br /&gt;*   Trying 72.21.214.128... connected&lt;br /&gt;* Connected to www.amazon.com (72.21.214.128) port 443 (#0)&lt;br /&gt;* successfully set certificate verify locations:&lt;br /&gt;*   CAfile: /opt/local/share/curl/curl-ca-bundle.crt&lt;br /&gt;  CApath: none&lt;br /&gt;* SSLv3, TLS handshake, Client hello (1):&lt;br /&gt;* SSLv3, TLS handshake, Server hello (2):&lt;br /&gt;* SSLv3, TLS handshake, CERT (11):&lt;br /&gt;* SSLv3, TLS handshake, Server finished (14):&lt;br /&gt;* SSLv3, TLS handshake, Client key exchange (16):&lt;br /&gt;* SSLv3, TLS change cipher, Client hello (1):&lt;br /&gt;* SSLv3, TLS handshake, Finished (20):&lt;br /&gt;* SSLv3, TLS change cipher, Client hello (1):&lt;br /&gt;* SSLv3, TLS handshake, Finished (20):&lt;br /&gt;* SSL connection using RC4-MD5&lt;br /&gt;* Server certificate:&lt;br /&gt;*   subject: C=US; ST=Washington; L=Seattle; O=Amazon.com Inc.; CN=www.amazon.com&lt;br /&gt;*   start date: 2010-07-15 00:00:00 GMT&lt;br /&gt;*   expire date: 2013-07-14 23:59:59 GMT&lt;br /&gt;*   common name: www.amazon.com (matched)&lt;br /&gt;*   issuer: C=US; O=VeriSign, Inc.; OU=VeriSign Trust Network; OU=Terms of use at https://www.verisign.com/rpa (c)09; CN=VeriSign Class 3 Secure Server CA - G2&lt;br /&gt;*   SSL certificate verify ok.&lt;br /&gt;&amp;gt; GET / HTTP/1.1&lt;br /&gt;&amp;gt; User-Agent: curl/7.21.2 (x86_64-apple-darwin10.5.0) libcurl/7.21.2 OpenSSL/1.0.0b zlib/1.2.5 libidn/1.19&lt;br /&gt;&amp;gt; Host: www.amazon.com&lt;br /&gt;&amp;gt; Accept: */*&lt;br /&gt;&amp;gt; &lt;br /&gt;&amp;lt; HTTP/1.1 301 Moved Permanently&lt;br /&gt;&amp;lt; Date: Thu, 02 Dec 2010 07:22:22 GMT&lt;br /&gt;&amp;lt; Server: Server&lt;br /&gt;&amp;lt; Set-Cookie: skin=noskin; path=/; domain=.amazon.com; expires=Thu, 02-Dec-2010 07:22:22 GMT&lt;br /&gt;&amp;lt; Location: http://www.amazon.com/&lt;br /&gt;&amp;lt; Content-Length: 230&lt;br /&gt;&amp;lt; nnCoection: close&lt;br /&gt;&amp;lt; Content-Type: text/html; charset=iso-8859-1&lt;br /&gt;&amp;lt; &lt;br /&gt;&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//IETF//DTD HTML 2.0//EN&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;301 Moved Permanently&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Moved Permanently&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;The document has moved &amp;lt;a href=&amp;quot;http://www.amazon.com/&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;br /&gt;* Connection #0 to host www.amazon.com left intact&lt;br /&gt;* Closing connection #0&lt;br /&gt;* SSLv3, TLS alert, Client hello (1):&lt;/pre&gt;This HTTPS connection works fine, because, the client trusts the CA of the Amazon's SSL certificate.&lt;br /&gt;&lt;br /&gt;By going through the logs you will see, the CA certificates are verified against the curl-ca-bundle.crt file located at /opt/local/share/curl/curl-ca-bundle.crt&lt;br /&gt;&lt;br /&gt;If you have a look at the above file, you will see all the trusted CAs listed there..&lt;br /&gt;&lt;pre name="code" class="html"&gt;Verisign Class 1 Public Primary Certification Authority&lt;br /&gt;=======================================================&lt;br /&gt;-----BEGIN CERTIFICATE-----&lt;br /&gt;MIICPDCCAaUCED9pHoGc8JpK83P/uUii5N0wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx&lt;br /&gt;FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5&lt;br /&gt;IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow&lt;br /&gt;XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAx&lt;br /&gt;IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA&lt;br /&gt;A4GNADCBiQKBgQDlGb9to1ZhLZlIcfZn3rmN67eehoAKkQ76OCWvRoiC5XOooJskXQ0fzGVuDLDQ&lt;br /&gt;VoQYh5oGmxChc9+0WDlrbsH2FdWoqD+qEgaNMax/sDTXjzRniAnNFBHiTkVWaR94AoDa3EeRKbs2&lt;br /&gt;yWNcxeDXLYd7obcysHswuiovMaruo2fa2wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFgVKTk8d6Pa&lt;br /&gt;XCUDfGD67gmZPCcQcMgMCeazh88K4hiWNWLMv5sneYlfycQJ9M61Hd8qveXbhpxoJeUwfLaJFf5n&lt;br /&gt;0a3hUKw8fGJLj7qE1xIVGx/KXQ/BUpQqEZnae88MNhPVNdwQGVnqlMEAv3WP2fr9dgTbYruQagPZ&lt;br /&gt;RjXZ+Hxb&lt;br /&gt;-----END CERTIFICATE-----&lt;br /&gt;&lt;br /&gt;Verisign Class 3 Public Primary Certification Authority&lt;br /&gt;=======================================================&lt;br /&gt;-----BEGIN CERTIFICATE-----&lt;br /&gt;MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx&lt;br /&gt;FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5&lt;br /&gt;IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow&lt;br /&gt;XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz&lt;br /&gt;IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA&lt;br /&gt;A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94&lt;br /&gt;f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol&lt;br /&gt;hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky&lt;br /&gt;CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX&lt;br /&gt;bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/&lt;br /&gt;D/xwzoiQ&lt;br /&gt;-----END CERTIFICATE-----&lt;/pre&gt;In the case of Amazon, it's Verisign who the CA is..&lt;br /&gt;&lt;br /&gt;3. Let's try to invoke https://amazon.com [Not www.amazon.com]&lt;br /&gt;&lt;pre name="code" class="html"&gt;$ curl -v https://amazon.com&lt;br /&gt;* About to connect() to amazon.com port 443 (#0)&lt;br /&gt;*   Trying 72.21.210.250... connected&lt;br /&gt;* Connected to amazon.com (72.21.210.250) port 443 (#0)&lt;br /&gt;* successfully set certificate verify locations:&lt;br /&gt;*   CAfile: /opt/local/share/curl/curl-ca-bundle.crt&lt;br /&gt;  CApath: none&lt;br /&gt;* SSLv3, TLS handshake, Client hello (1):&lt;br /&gt;* SSLv3, TLS handshake, Server hello (2):&lt;br /&gt;* SSLv3, TLS handshake, CERT (11):&lt;br /&gt;* SSLv3, TLS handshake, Server finished (14):&lt;br /&gt;* SSLv3, TLS handshake, Client key exchange (16):&lt;br /&gt;* SSLv3, TLS change cipher, Client hello (1):&lt;br /&gt;* SSLv3, TLS handshake, Finished (20):&lt;br /&gt;* SSLv3, TLS change cipher, Client hello (1):&lt;br /&gt;* SSLv3, TLS handshake, Finished (20):&lt;br /&gt;* SSL connection using RC4-MD5&lt;br /&gt;* Server certificate:&lt;br /&gt;*   subject: C=US; ST=Washington; L=Seattle; O=Amazon.com Inc.; CN=www.amazon.com&lt;br /&gt;*   start date: 2010-07-15 00:00:00 GMT&lt;br /&gt;*   expire date: 2013-07-14 23:59:59 GMT&lt;br /&gt;* SSL: certificate subject name 'www.amazon.com' does not match target host name 'amazon.com'&lt;br /&gt;* Closing connection #0&lt;br /&gt;* SSLv3, TLS alert, Client hello (1):&lt;br /&gt;curl: (51) SSL: certificate subject name 'www.amazon.com' does not match target host name 'amazon.com'&lt;/pre&gt;This fails.. Why ? It's the same CA which is trusted by the Curl client - but it fails due to the host name verification. The certificate was issued to www.amazon.com - not for amazon.com&lt;br /&gt;&lt;br /&gt;4. Let's try to invoke https://amazon.com [Not www.amazon.com] - by disabling SSL validations with the argument -k&lt;br /&gt;&lt;pre name="code" class="html"&gt;curl -v -k https://amazon.com&lt;br /&gt;* About to connect() to amazon.com port 443 (#0)&lt;br /&gt;*   Trying 72.21.210.250... connected&lt;br /&gt;* Connected to amazon.com (72.21.210.250) port 443 (#0)&lt;br /&gt;* successfully set certificate verify locations:&lt;br /&gt;*   CAfile: /opt/local/share/curl/curl-ca-bundle.crt&lt;br /&gt;  CApath: none&lt;br /&gt;* SSLv3, TLS handshake, Client hello (1):&lt;br /&gt;* SSLv3, TLS handshake, Server hello (2):&lt;br /&gt;* SSLv3, TLS handshake, CERT (11):&lt;br /&gt;* SSLv3, TLS handshake, Server finished (14):&lt;br /&gt;* SSLv3, TLS handshake, Client key exchange (16):&lt;br /&gt;* SSLv3, TLS change cipher, Client hello (1):&lt;br /&gt;* SSLv3, TLS handshake, Finished (20):&lt;br /&gt;* SSLv3, TLS change cipher, Client hello (1):&lt;br /&gt;* SSLv3, TLS handshake, Finished (20):&lt;br /&gt;* SSL connection using RC4-MD5&lt;br /&gt;* Server certificate:&lt;br /&gt;*   subject: C=US; ST=Washington; L=Seattle; O=Amazon.com Inc.; CN=www.amazon.com&lt;br /&gt;*   start date: 2010-07-15 00:00:00 GMT&lt;br /&gt;*   expire date: 2013-07-14 23:59:59 GMT&lt;br /&gt;*   common name: www.amazon.com (does not match 'amazon.com')&lt;br /&gt;*   issuer: C=US; O=VeriSign, Inc.; OU=VeriSign Trust Network; OU=Terms of use at https://www.verisign.com/rpa (c)09; CN=VeriSign Class 3 Secure Server CA - G2&lt;br /&gt;*   SSL certificate verify ok.&lt;br /&gt;&amp;gt; GET / HTTP/1.1&lt;br /&gt;&amp;gt; User-Agent: curl/7.21.2 (x86_64-apple-darwin10.5.0) libcurl/7.21.2 OpenSSL/1.0.0b zlib/1.2.5 libidn/1.19&lt;br /&gt;&amp;gt; Host: amazon.com&lt;br /&gt;&amp;gt; Accept: */*&lt;br /&gt;&amp;gt; &lt;br /&gt;&amp;lt; HTTP/1.1 301 Moved Permanently&lt;br /&gt;&amp;lt; Date: Thu, 02 Dec 2010 07:38:04 GMT&lt;br /&gt;&amp;lt; Server: Server&lt;br /&gt;&amp;lt; Location: https://www.amazon.com/&lt;br /&gt;&amp;lt; Content-Length: 231&lt;br /&gt;&amp;lt; Cneonction: close&lt;br /&gt;&amp;lt; Content-Type: text/html; charset=iso-8859-1&lt;br /&gt;&amp;lt; &lt;br /&gt;&amp;lt;!DOCTYPE HTML PUBLIC &amp;quot;-//IETF//DTD HTML 2.0//EN&amp;quot;&amp;gt;&lt;br /&gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;301 Moved Permanently&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h1&amp;gt;Moved Permanently&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;The document has moved &amp;lt;a href=&amp;quot;https://www.amazon.com/&amp;quot;&amp;gt;here&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;br /&gt;* Connection #0 to host amazon.com left intact&lt;br /&gt;* Closing connection #0&lt;br /&gt;* SSLv3, TLS alert, Client hello (1):&lt;/pre&gt;This succeeds.. since we asked Curl to ignore SSL validation issues..&lt;br /&gt;&lt;br /&gt;5. Let's try to invoke a service with a certificate issued from a CA not trusted by Curl. I am using WSO2 ESB here - which ships with a self-signed certificate - so, obviously not trusted by Curl&lt;br /&gt;&lt;pre name="code" class="html"&gt;$ curl -v https://localhost:9447/carbon&lt;br /&gt;* About to connect() to localhost port 9447 (#0)&lt;br /&gt;*   Trying ::1... connected&lt;br /&gt;* Connected to localhost (::1) port 9447 (#0)&lt;br /&gt;* successfully set certificate verify locations:&lt;br /&gt;*   CAfile: /opt/local/share/curl/curl-ca-bundle.crt&lt;br /&gt;  CApath: none&lt;br /&gt;* SSLv3, TLS handshake, Client hello (1):&lt;br /&gt;* SSLv3, TLS handshake, Server hello (2):&lt;br /&gt;* SSLv3, TLS handshake, CERT (11):&lt;br /&gt;* SSLv3, TLS alert, Server hello (2):&lt;br /&gt;* SSL certificate problem, verify that the CA cert is OK. Details:&lt;br /&gt;error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed&lt;br /&gt;* Closing connection #0&lt;br /&gt;curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:&lt;br /&gt;error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed&lt;br /&gt;More details here: http://curl.haxx.se/docs/sslcerts.html&lt;/pre&gt;You will see, above fails since server certification is not trusted.&lt;br /&gt;&lt;br /&gt;6. Let's improve step-5 - by asking Curl to trust our CA certificate.&lt;br /&gt;&lt;pre name="code" class="html"&gt;$ curl -v --cacert esbcert.pem  https://localhost:9447/carbon&lt;/pre&gt;Here we specify CA certificate of the ESB - with the argument --cacert&lt;br /&gt;&lt;br /&gt;Notes :&lt;br /&gt;&lt;br /&gt;1. To find the path of the trusted CA bundle&lt;br /&gt;&lt;br /&gt;$ &lt;b&gt;curl-config --ca&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;2. To set your own trusted CA bundle&lt;br /&gt;&lt;br /&gt;$ &lt;b&gt;export CURL_CA_BUNDLE=my-ca-bundle.crt&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-985606344490238659?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/985606344490238659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=985606344490238659' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/985606344490238659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/985606344490238659'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/curl-with-https.html' title='Curl with HTTPS'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-3602997762156470125</id><published>2010-12-02T01:25:00.007+05:30</published><updated>2010-12-02T01:41:47.477+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='TCP'/><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>Hand-crafting TCP/IP handshake with Scapy</title><content type='html'>The following video explains TCP/IP 3-way handshake - and later we are going to hand-craft the packets used in TCP/IP handshake with Scapy.&lt;br /&gt;&lt;br /&gt;&lt;object width="480" height="385"&gt;&lt;param name="movie" value="http://www.youtube.com/v/dWnuqCsahNw?fs=1&amp;amp;hl=en_US"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/dWnuqCsahNw?fs=1&amp;amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br /&gt;&lt;br /&gt;First lets define the server and the client,&lt;br /&gt;&lt;br /&gt;Server : 192.168.2.1&lt;br /&gt;Client : 192.168.2.11&lt;br /&gt;&lt;br /&gt;First I will start Scapy at the client side, to track the packets flowing in between client and the server&lt;pre name="code" class="html"&gt;$ sudo scapy&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; a=sniff(filter="tcp")&lt;/pre&gt;Now lets open up another console in the client end and start Scapy again..&lt;pre name="code" class="html"&gt;$ sudo scapy&lt;br /&gt;Welcome to Scapy (2.1.0)&lt;br /&gt;&gt;&gt;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;u&gt;Step - 1&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Now, first create an IP packet - you may notice the src is set to the client IP and the dst been set to the server IP.&lt;br /&gt;&lt;pre name="code" class="html"&gt;&gt;&gt;&gt; ip=IP(src="192.168.2.11", dst="192.168.2.1")&lt;br /&gt;&lt;/pre&gt;Then, we need to create a TCP packet with SYN - see the flags been set to "S". And we are also setting a sequence number...&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Step - 2&lt;/u&gt;&lt;pre name="code" class="html"&gt;&gt;&gt;&gt; SYN=TCP(sport=1500, dport=80, flags="S", seq=100)&lt;br /&gt;&lt;/pre&gt;Then we need to send the crafted packet. With this we are expecting SYN ACK from the server.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Step - 3&lt;/u&gt;&lt;br /&gt;&lt;pre name="code" class="html"&gt;&gt;&gt;&gt; SYNACK=sr1(ip/SYN)&lt;br /&gt;&lt;/pre&gt;But, if you press Ctrl+C and then a.nsummary() on the other console we are running Scapy, you will see an RST been sent from the client after the SYN.&lt;pre name="code" class="html"&gt;$ sudo scapy&lt;br /&gt;&gt;&gt;&gt; a=sniff(filter="tcp")&lt;br /&gt;Ctrl+C&lt;br /&gt;&gt;&gt;&gt;a.nsummary()&lt;br /&gt;0000 Ether / IP / TCP 192.168.2.11:1500 &gt; 192.168.2.1:www S&lt;br /&gt;0001 Ether / IP / TCP 192.168.2.11:1500 &gt; 192.168.2.1:www R&lt;br /&gt;&lt;/pre&gt;Linux kernel automatically sets appropriate header values and knows how to complete a TCP 3 way handshake. &lt;br /&gt;&lt;br /&gt;Scapy does not use these kernel services. It creates a raw socket. &lt;br /&gt;&lt;br /&gt;In the previous case, as soon as the kernel sees the SYN/ACK it responded with a RST - because it did not send the SYN [it was through Scapy].&lt;br /&gt;&lt;br /&gt;So, we need to avoid this behavior and this is how we do it. We can use iptables on our host to suppress outbound RSTs to the destination we are working with.&lt;br /&gt;&lt;br /&gt;sudo iptables -A OUTPUT -p tcp --tcp-flags RST RST -s 192.168.2.11 -dport 1500 -j DROP&lt;br /&gt;&lt;br /&gt;Once the above done performs steps 1 to 3 and you won't see an RST been sent from the client.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Step - 4&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Now the client needs to send ACK for the server's SYN.&lt;br /&gt;&lt;br /&gt;Here you will see the sequence number is increased by one and the the sequence number from the SYN ACK form the server been set as the ack.&lt;pre name="code" class="html"&gt;&gt;&gt;&gt; ACK=TCP(sport=1500, dport=80, flags="S", seq=101 ack=SYNACK.seq)&lt;br /&gt;&lt;/pre&gt;&lt;u&gt;Step - 5&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Send the client ACK to the server&lt;pre name="code" class="html"&gt;&gt;&gt;&gt;send(ip/ACK)&lt;br /&gt;&lt;/pre&gt;&lt;u&gt;Step - 6&lt;/u&gt;&lt;br /&gt;&lt;br /&gt;Let's go back to the first console window and view the flow between client and the server&lt;br /&gt;&lt;pre name="code" class="html"&gt;$ sudo scapy&lt;br /&gt;&gt;&gt;&gt; a=sniff(filter="tcp")&lt;br /&gt;Ctrl+C&lt;br /&gt;&gt;&gt;&gt;a.nsummary()&lt;br /&gt;0000 Ether / IP / TCP 192.168.2.11:1500 &gt; 192.168.2.1:www S&lt;br /&gt;0001 Ether / IP / TCP 192.168.2.1:www &gt; 192.168.2.11:1500 SA&lt;br /&gt;0002 Ether / IP / TCP 192.168.2.11:1500 &gt; 192.168.2.1:www A&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-3602997762156470125?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/3602997762156470125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=3602997762156470125' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3602997762156470125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3602997762156470125'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/12/hand-crafting-tcp-handshake-with-scapy.html' title='Hand-crafting TCP/IP handshake with Scapy'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-7659754460880046981</id><published>2010-11-30T17:19:00.003+05:30</published><updated>2010-12-01T23:27:11.116+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Security'/><title type='text'>Simulating a Smurf attack with Scapy</title><content type='html'>&lt;a href="http://en.wikipedia.org/wiki/Smurf_attack"&gt;Wikipedia&lt;/a&gt; says..&lt;br /&gt;&lt;blockquote&gt;The Smurf attack is a way of generating significant computer network traffic on a victim network. This is a type of denial-of-service attack that floods a target system via spoofed broadcast ping messages.&lt;br /&gt;&lt;br /&gt;This attack relies on a perpetrator sending a large amount of ICMP echo request (ping) traffic to IP broadcast addresses, all of which have a spoofed source IP address of the intended victim. &lt;br /&gt;&lt;br /&gt;If the routing device delivering traffic to those broadcast addresses delivers the IP broadcast to all hosts, most hosts on that IP network will take the ICMP echo request and reply to it with an echo reply, multiplying the traffic by the number of hosts responding.&lt;/blockquote&gt;&lt;br /&gt;To simulate a Smurf attack we need to do the following..&lt;br /&gt;&lt;br /&gt;1. Install Scapy &lt;br /&gt;&lt;br /&gt;On Mac &lt;a href="http://blog.facilelogin.com/2010/11/installing-scapy-on-mac-os-x.html"&gt;this&lt;/a&gt; is how you do it..&lt;br /&gt;&lt;br /&gt;On Ubuntu : sudo apt-get install python-scapy&lt;br /&gt;&lt;br /&gt;2. Send a large amount of ICMP request to the broadcast address of the victim network(Directed Broadcast Address).&lt;br /&gt;&lt;br /&gt;3. Source IP of the attacker must be spoofed.&lt;br /&gt;&lt;br /&gt;As per [2] when we send a ICMP request with a spoofed IP been set to the broadcast IP of the network, the server will broadcast the ICMP response to the entire network..&lt;br /&gt;&lt;br /&gt;In the following example with Scapy, we are not using a broadcast IP - instead using an IP address of a different machine in the network.&lt;br /&gt;&lt;br /&gt;Target machine IP : 192.168.2.11&lt;br /&gt;Server machine IP : 192.168.2.10&lt;br /&gt;&lt;br /&gt;From the attackers machine, I start Scapy;&lt;br /&gt;&lt;br /&gt;$ sudo scapy&lt;br /&gt;&lt;br /&gt;Then type the following - you can see the source IP been spoofed to the target machine IP.&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; send(IP(src="192.168.2.11", dst="192.168.2.10")/ICMP())&lt;br /&gt;&lt;br /&gt;That's it - since we want to confirm the response from the server, 192.168.2.10 goes to 192.168.2.11 - I am also running scapy there too..&lt;br /&gt;&lt;br /&gt;$ sudo scapy&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; a=sniff(filter="icmp and src 192.168.2.11")&lt;br /&gt;&lt;br /&gt;The above will trace ICMP traffic targeting 192.168.2.11 - after sometime press Ctrl+C and type the following on the target machine..&lt;br /&gt;&lt;br /&gt;&gt;&gt;&gt; a.nsummary()&lt;br /&gt;0000 Ether / IP / ICMP 192.168.2.11 &gt; 192.168.2.10 echo-request 0&lt;br /&gt;&lt;br /&gt;Smurf attacks can be prevented by,&lt;br /&gt;&lt;br /&gt;1. Configuring the individual hosts and routers not to respond to ping requests.&lt;br /&gt;2. Configuring routers not to forward packets directed to broadcast addresses.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-7659754460880046981?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/7659754460880046981/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=7659754460880046981' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7659754460880046981'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7659754460880046981'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/simulating-smurf-attack-with-scapy.html' title='Simulating a Smurf attack with Scapy'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-2625490868698954734</id><published>2010-11-29T15:22:00.002+05:30</published><updated>2010-11-29T15:32:58.780+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='WSO2'/><title type='text'>WSO2 @ University of Peradeniya Job Fair</title><content type='html'>University of Peradeniya Job Fair was held in Colombo - at IESL last Friday..&lt;br /&gt;&lt;br /&gt;Following is the presentation we did - well, there is a story around - you can build it your own :)&lt;br /&gt;&lt;br /&gt;&lt;div style="width:425px" id="__ss_5960325"&gt;&lt;object id="__sse5960325" width="425" height="355"&gt;&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=pera-101129034748-phpapp01&amp;stripped_title=wso2-uop-job-fair&amp;userName=prabathsiriwardena" /&gt;&lt;param name="allowFullScreen" value="true"/&gt;&lt;param name="allowScriptAccess" value="always"/&gt;&lt;embed name="__sse5960325" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=pera-101129034748-phpapp01&amp;stripped_title=wso2-uop-job-fair&amp;userName=prabathsiriwardena" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-2625490868698954734?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/2625490868698954734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=2625490868698954734' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2625490868698954734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2625490868698954734'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/wso2-university-of-peradeniya-job-fair.html' title='WSO2 @ University of Peradeniya Job Fair'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-2070722846287648738</id><published>2010-11-29T13:09:00.002+05:30</published><updated>2010-11-29T13:11:34.698+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><category scheme='http://www.blogger.com/atom/ns#' term='Mac'/><title type='text'>Installing Scapy on Mac OS X</title><content type='html'>I wouldn't have written this blog post, if everything went well for me while doing the $subject.. &lt;br /&gt;&lt;br /&gt;I was trying with &lt;a href="http://blog.facilelogin.com/2010/11/building-and-installing-macports-on-mac.html"&gt;MacPorts&lt;/a&gt; - it gave me the following error..&lt;br /&gt;&lt;br /&gt;:error:configure db46 requires the Java for Mac OS X development headers.&lt;br /&gt;:error:configure Download the Java Developer Package from: &lt;https://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wa/getSoftware?bundleID=20719&gt;&lt;br /&gt;:error:configure Target org.macports.configure returned: missing Java headers&lt;br /&gt;:debug:configure Backtrace: missing Java headers while executing&lt;br /&gt;"$pre $targetname"&lt;br /&gt;&lt;br /&gt;By going through some of the MacPorts tickets found out that we need to have Java for Mac OS X 10.6 Update 3 Developer Package installed first - which you can get from &lt;a href="http://connect.apple.com/cgi-bin/WebObjects/MemberSite.woa/wo/7.1.17.2.1.3.3.1.0.1.1.0.3.9.3.3.1"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Once that is done, only following is needed..&lt;br /&gt;&lt;br /&gt;$ &lt;b&gt;sudo port install scapy&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-2070722846287648738?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/2070722846287648738/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=2070722846287648738' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2070722846287648738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2070722846287648738'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/installing-scapy-on-mac-os-x.html' title='Installing Scapy on Mac OS X'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-8204761021055820926</id><published>2010-11-25T14:24:00.004+05:30</published><updated>2010-11-29T13:15:03.483+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kerberos'/><title type='text'>Kerberos Debugging Tips</title><content type='html'>I worked on adding Kerberos support for Apache Rampart and WSS4J during last few weeks and interop testing with WCF.&lt;br /&gt;&lt;br /&gt;Following lists some useful debugging tips I came across..&lt;br /&gt;&lt;br /&gt;1. How to list all the Kerberos tickets issued to the logged in client principal in Windows&lt;pre name="code" class="html"&gt;c:\Program Files (x86)\Resource Kit&gt;klist&lt;br /&gt;&lt;br /&gt;Current LogonId is 0:0x29a6f&lt;br /&gt;&lt;br /&gt;Cached Tickets: (2)&lt;br /&gt;&lt;br /&gt;#0&gt;     Client: administrator @ WSO2.COM&lt;br /&gt;        Server: krbtgt/WSO2.COM @ WSO2.COM&lt;br /&gt;        KerbTicket Encryption Type: AES-256-CTS-HMAC-SHA1-96&lt;br /&gt;        Ticket Flags 0x40e00000 -&gt; forwardable renewable initial pre_authent&lt;br /&gt;        Start Time: 11/25/2010 13:19:58 (local)&lt;br /&gt;        End Time:   11/25/2010 23:19:58 (local)&lt;br /&gt;        Renew Time: 12/2/2010 13:19:58 (local)&lt;br /&gt;        Session Key Type: AES-256-CTS-HMAC-SHA1-96&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;#1&gt;     Client: administrator @ WSO2.COM&lt;br /&gt;        Server: service/myserver @ WSO2.COM&lt;br /&gt;        KerbTicket Encryption Type: RSADSI RC4-HMAC(NT)&lt;br /&gt;        Ticket Flags 0x40a40000 -&gt; forwardable renewable pre_authent ok_as_delegate&lt;br /&gt;        Start Time: 11/25/2010 13:19:58 (local)&lt;br /&gt;        End Time:   11/25/2010 23:19:58 (local)&lt;br /&gt;        Renew Time: 12/2/2010 13:19:58 (local)&lt;br /&gt;        Session Key Type: RSADSI RC4-HMAC(NT)&lt;/pre&gt;&lt;br /&gt;2. How to remove cached Kerberos tickets in Windows&lt;pre name="code" class="html"&gt;c:\Program Files (x86)\Resource Kit&gt;klist purge&lt;br /&gt;&lt;br /&gt;Current LogonId is 0:0x29a6f&lt;br /&gt;        Deleting all tickets:&lt;br /&gt;        Ticket(s) purged!&lt;/pre&gt;&lt;br /&gt;3. How to publish Kerberos error logs in to the Event Viewer in Windows&lt;br /&gt;&lt;br /&gt;&lt;b&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters&lt;/b&gt;&lt;br /&gt;The Parameters subkey stores configuration options for the Kerberos V5 authentication protocol in Windows Server 2003/2008.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;LogValue&lt;/u&gt;&lt;br /&gt;Registry path&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters&lt;br /&gt;&lt;br /&gt;This entry does not exist in the registry by default. The default value is false - to publish to to Event Viewer set it to 1&lt;br /&gt;&lt;br /&gt;Following are some more registry entries related to Kerberos...&lt;br /&gt;&lt;br /&gt;&lt;u&gt;AllowTgtSessionKey&lt;/u&gt;&lt;br /&gt;Registry path&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters&lt;br /&gt;&lt;br /&gt;This entry controls whether session keys are exported with initial or cross-realm TGTs. This entry does not exist in the registry by default. The default value is false due to security concerns.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;CacheS4UTickets&lt;/u&gt;&lt;br /&gt;Registry path&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters&lt;br /&gt;&lt;br /&gt;This entry enables and disables Service-for-User (S4U) caching. This entry does not exist in the registry by default. The default value is true.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;ClientIpAddresses&lt;/u&gt;&lt;br /&gt;Registry path&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters&lt;br /&gt;&lt;br /&gt;This entry controls adding IP addresses in KRB_AS_REQ, thus forcing the Caddr field to contain IP addresses in all tickets. This entry does not exist in the registry by default. The default value is false, due to potential DHCP client and network address translation (NAT) issues.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;DefaultEncryptionType&lt;/u&gt;&lt;br /&gt;Registry path&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters&lt;br /&gt;&lt;br /&gt;This entry controls the default encryption type for PreAuth. This entry does not exist in the registry by default. The default value is KERB_ETYPE_RC4_HMAC_NT.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;FarKdcTimeout&lt;/u&gt;&lt;br /&gt;Registry path&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters&lt;br /&gt;&lt;br /&gt;This entry controls the time-out interval, in minutes, that is used to invalidate a domain controller from a different site in the domain controller cache. This entry does not exist in the registry by default. The default value is 10 minutes.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;KdcBackoffTime&lt;/u&gt;&lt;br /&gt;Registry path&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters&lt;br /&gt;&lt;br /&gt;This entry specifies a time value, in seconds, between successive calls to the Key Distribution Center (KDC) if the previous call failed. This entry does not exist in the registry by default. The default value is 5 seconds.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;KdcSendRetries&lt;/u&gt;&lt;br /&gt;Registry path&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters&lt;br /&gt;&lt;br /&gt;This entry controls the number of retry attempts that a client makes in order to contact a KDC. This entry does not exist in the registry by default. The default value is 3.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;KdcWaitTime&lt;/u&gt;&lt;br /&gt;Registry path&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters&lt;br /&gt;&lt;br /&gt;This entry specifies a time value, in seconds, that is used to time out the Winsock calls. This entry does not exist in the registry by default. The default value is 5 seconds.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;KerbDebugLevel&lt;/u&gt;&lt;br /&gt;Registry path&lt;br /&gt;HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\Kerberos\Parameters&lt;br /&gt;&lt;br /&gt;4. How to set a Service Principal Name [SPN] for a user in AD - in Windows&lt;pre name="code" class="html"&gt;c:\Program Files (x86)\Resource Kit&gt;setspn -A test/wso2 prabath&lt;br /&gt;Registering ServicePrincipalNames for CN=prabath,CN=Users,DC=wso2,DC=com&lt;br /&gt;        test/wso2&lt;br /&gt;Updated object&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;5. How to list all the SPNs of a given user in AD - Windows&lt;pre name="code" class="html"&gt;c:\Program Files (x86)\Resource Kit&gt;setspn -L prabath&lt;br /&gt;Registered ServicePrincipalNames for CN=prabath,CN=Users,DC=wso2,DC=com:&lt;br /&gt;        test/wso2&lt;br /&gt;        service/myserver&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;6. How to make java clients work with IWA&lt;br /&gt;&lt;br /&gt;By default, Windows does not allow the session key of a TGT to be accessed. Add the following registry key on the client side, so that the session key for TGT is accessible and Java can use it to acquire additional service tickets.&lt;br /&gt;&lt;br /&gt;For Windows XP and Windows 2000, the registry key and value should be:&lt;br /&gt;&lt;br /&gt;HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos&lt;br /&gt;Value Name: allowtgtsessionkey&lt;br /&gt;Value Type: REG_DWORD&lt;br /&gt;Value: 0x01&lt;br /&gt;&lt;br /&gt;For Windows 2003 and Windows Vista, the registry key and value should be:&lt;br /&gt;&lt;br /&gt;HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\Kerberos\Parameters&lt;br /&gt;&lt;br /&gt;Value Name: allowtgtsessionkey&lt;br /&gt;Value Type: REG_DWORD&lt;br /&gt;Value: 0x01&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-8204761021055820926?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/8204761021055820926/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=8204761021055820926' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8204761021055820926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8204761021055820926'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/kerberos-debugging-tips.html' title='Kerberos Debugging Tips'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-3057113017244672212</id><published>2010-11-24T01:31:00.007+05:30</published><updated>2010-11-24T04:07:35.919+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tech Videos'/><title type='text'>FOSDEM Tech Talks</title><content type='html'>&lt;b&gt;&lt;u&gt;Secure communications with Jabber&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe width="480" height="295" src="http://www.youtube.com/embed/D5WHvNTzywE?fs=1" frameborder="0"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;AMQP&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe width="480" height="295" src="http://www.youtube.com/embed/bQgPArfbXm4?fs=1" frameborder="0"&gt;&lt;/iframe&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;MySQL High Availability Solutions&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;iframe width="480" height="295" src="http://www.youtube.com/embed/Z33-bWSMCN0?fs=1" frameborder="0"&gt;&lt;/iframe&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-3057113017244672212?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/3057113017244672212/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=3057113017244672212' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3057113017244672212'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/3057113017244672212'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/secure-communications-with-jabber.html' title='FOSDEM Tech Talks'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/D5WHvNTzywE/default.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-5457096583898950736</id><published>2010-11-23T16:54:00.001+05:30</published><updated>2010-11-23T17:01:23.612+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mac'/><title type='text'>Mac OS X 10.6 terminal gets so long to load</title><content type='html'>This is something I faced after using the MacBook Pro for a month long...&lt;br /&gt;&lt;br /&gt;Following is the solution..&lt;br /&gt;&lt;br /&gt;&lt;b&gt;sudo rm -f /private/var/log/asl/*&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Make sure, you backed up any logs you require before executing the above...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-5457096583898950736?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/5457096583898950736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=5457096583898950736' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5457096583898950736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5457096583898950736'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/mac-os-x-106-terminal-gets-so-long-to.html' title='Mac OS X 10.6 terminal gets so long to load'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-1341007844217497007</id><published>2010-11-22T23:34:00.001+05:30</published><updated>2010-11-22T23:35:56.229+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>Capturing via tcpdump to view in Wireshark</title><content type='html'>$&lt;b&gt;sudo tcpdump -i en1 -s0 -w captured.pcap&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;-i&lt;/b&gt; Listening interface&lt;br /&gt;&lt;br /&gt;&lt;b&gt;-s&lt;/b&gt; Snarf  snaplen  bytes  of  data from each packet rather than the default of 64K bytes.  Packets truncated because  of  a  limited snapshot  are  indicated  in the output with ``[|proto]'', where proto is the name of the protocol level at which the  truncation has  occurred.  Note that taking larger snapshots both increases the amount of time it takes to process packets and, effectively, decreases  the amount of packet buffering.  This may cause pack- ets to be lost.  You should limit snaplen to the smallest number that will capture the protocol information you're interested in. Setting snaplen to 0 means use  the  required  length  to  catch whole packets.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-1341007844217497007?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/1341007844217497007/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=1341007844217497007' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1341007844217497007'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1341007844217497007'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/capturing-via-tcpdump-to-view-in.html' title='Capturing via tcpdump to view in Wireshark'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-4272208380148155214</id><published>2010-11-22T15:33:00.002+05:30</published><updated>2010-11-24T02:11:45.366+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Carbon'/><title type='text'>Setting up WSO2 P2 Repo Locally</title><content type='html'>Currently WSO2 doesn't host the P2 repository as a single distribution to download - so whenever you want to add a new Feature, you need to point your Carbon instance to the online p2 repo hosted at &lt;a href="http://dist.wso2.org/p2/carbon/releases/3.0.0/"&gt;http://dist.wso2.org/p2/carbon/releases/3.0.0/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;This is how you can download the entire repository and set it up locally..&lt;br /&gt;&lt;br /&gt;$ &lt;b&gt;pwd&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;&lt;i&gt;/Users/prabath/p2_repo&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;$ &lt;b&gt;wget -r -l inf http://dist.wso2.org/p2/carbon/releases/3.0.0/&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The above will download the entire P2 repo to the local machine.&lt;br /&gt;&lt;br /&gt;Once that is done, go to the running carbon instance, Configure --&gt; Features --&gt; Settings --&gt; Add Repository --&gt; Select Location as Local and set it as, /Users/prabath/p2_repo/dist.wso2.org/p2/carbon/releases/3.0.0 and that's it...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-4272208380148155214?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/4272208380148155214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=4272208380148155214' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4272208380148155214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4272208380148155214'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/setting-up-wso2-p2-repo-locally.html' title='Setting up WSO2 P2 Repo Locally'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-5596849925792698636</id><published>2010-11-22T12:28:00.002+05:30</published><updated>2010-11-22T13:22:52.707+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Mac'/><title type='text'>Building and installing MacPorts on Mac OS X 10.6 from source</title><content type='html'>The &lt;a href="http://www.macports.org/"&gt;MacPorts&lt;/a&gt; project is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the Mac OS X operating system. &lt;br /&gt;&lt;br /&gt;1. &lt;b&gt;svn co http://svn.macports.org/repository/macports/trunk/base/ macports&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;2. &lt;b&gt;cd macports&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;3. &lt;b&gt;./configure&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;4. &lt;b&gt;make&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;5.&lt;b&gt; sudo make install&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;6. &lt;b&gt;sudo /opt/local/bin/port -v selfupdate&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;To test the setup, lets try to install MySQL via MacPorts...&lt;br /&gt;&lt;br /&gt;1. &lt;b&gt;export PATH=/Developer/usr/bin:/Developer/usr/sbin:/opt/local/bin:/opt/local/sbin:$PATH&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;2. &lt;b&gt;sudo port install mysql5-server&lt;/b&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-5596849925792698636?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/5596849925792698636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=5596849925792698636' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5596849925792698636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5596849925792698636'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/building-and-installing-macports-on-mac.html' title='Building and installing MacPorts on Mac OS X 10.6 from source'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-8874455315835072792</id><published>2010-11-19T08:21:00.009+05:30</published><updated>2010-11-19T11:25:13.887+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><category scheme='http://www.blogger.com/atom/ns#' term='Carbon'/><title type='text'>SSL Debugging - Part - II - Intercepting traffic between WSO2 Carbon FE and BE</title><content type='html'>All WSO2 products are based on WSO2 Carbon, which sits as the core for all of them.&lt;br /&gt;&lt;br /&gt;We do have a clear Front-End [FE], Back-End [BE] separation - where the FE web application talks to the BE, via web service calls.&lt;br /&gt;&lt;br /&gt;This benefits the end user - which adds the flexibility of developing his own client to the corresponding back end functionality in a language independent manner.&lt;br /&gt;&lt;br /&gt;All UI components you see in the default distribution talk to the BE services via SOAP over HTTPS.&lt;br /&gt;&lt;br /&gt;In case of digging in to an issue - since this is on HTTPS - it's hard to intercept the communication channel and figure what exact messages being passed from FE to BE.&lt;br /&gt;&lt;br /&gt;This is how you can do it - to intercept messages flowing over SSL.&lt;br /&gt;&lt;br /&gt;Prerequisites:&lt;br /&gt;1. &lt;a href="http://www.rtfm.com/ssldump/Ssldump.html"&gt;ssldump&lt;/a&gt; &lt;br /&gt;2. The private key of WSO2 Carbon, in PEM format - you can download it from &lt;a href="http://cache.facilelogin.com/wso2carbon.pem"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Run the following command from where you have the private key, and start any WSO2 Carbon based product - say on HTTPS port 9443&lt;br /&gt;&lt;br /&gt;&lt;b&gt;:\&gt; sudo ssldump -Ad -k wso2carbon.pem  -p wso2carbon  -i lo0 host localhost and port 9443&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Make sure to have the correct interface set as per your system.[-i lo0] and start the ssldump before you start the server.&lt;br /&gt;&lt;br /&gt;Now you can track all the messages between FE and BE in clear text.&lt;pre name="code" class="html"&gt;1 8 0.0621 (0.0007) C&gt;SV3.1(203) application_data&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;POST /services/AuthenticationAdmin HTTP/1.1&lt;br /&gt;Content-Type: application/soap+xml; charset=UTF-8; action="urn:login"&lt;br /&gt;User-Agent: Axis2&lt;br /&gt;Host: localhost:9443&lt;br /&gt;Transfer-Encoding: chunked&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;1 9 0.0626 (0.0005) C&gt;SV3.1(399) application_data&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;173&lt;br /&gt;    &amp;lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;br /&gt;&amp;lt;soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"&gt;&lt;br /&gt; &amp;lt;soapenv:Body&gt;&lt;br /&gt;  &amp;lt;ns1:login xmlns:ns1="http://authentication.services.core.carbon.wso2.org"&gt;&lt;br /&gt;   &amp;lt;ns1:username&gt;admin&amp;lt;/ns1:username&gt;&lt;br /&gt;   &amp;lt;ns1:password&gt;admin&amp;lt;/ns1:password&gt;&lt;br /&gt;   &amp;lt;ns1:remoteAddress&gt;0:0:0:0:0:0:0:1%0&amp;lt;/ns1:remoteAddress&gt;&lt;br /&gt;  &amp;lt;/ns1:login&gt;&lt;br /&gt; &amp;lt;/soapenv:Body&gt;&lt;br /&gt;&amp;lt;/soapenv:Envelope&gt;&lt;br /&gt;0&lt;br /&gt;&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;1 10 0.2071 (0.1445) S&gt;CV3.1(544) application_data&lt;br /&gt;---------------------------------------------------------------&lt;br /&gt;HTTP/1.1 200 OK&lt;br /&gt;Server: Apache-Coyote/1.1&lt;br /&gt;Set-Cookie: JSESSIONID=37FC902E5E7C6C0D081E28B4DF067A76; Path=/; Secure&lt;br /&gt;Content-Type: application/soap+xml;charset=UTF-8&lt;br /&gt;Transfer-Encoding: chunked&lt;br /&gt;Date: Fri, 19 Nov 2010 02:44:26 GMT&lt;br /&gt;&lt;br /&gt;11f&lt;br /&gt;    &amp;lt;?xml version='1.0' encoding='UTF-8'?&gt;&lt;br /&gt;&amp;lt;soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"&gt;&lt;br /&gt; &amp;lt;soapenv:Body&gt;&lt;br /&gt;  &amp;lt;ns:loginResponse&lt;br /&gt;   xmlns:ns="http://authentication.services.core.carbon.wso2.org"&gt;&lt;br /&gt;   &amp;lt;ns:return&gt;true&amp;lt;/ns:return&gt;&lt;br /&gt;  &amp;lt;/ns:loginResponse&gt;&lt;br /&gt; &amp;lt;/soapenv:Body&gt;&lt;br /&gt;&amp;lt;/soapenv:Envelope&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-8874455315835072792?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/8874455315835072792/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=8874455315835072792' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8874455315835072792'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8874455315835072792'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/ssl-debugging-part-ii-intercepting.html' title='SSL Debugging - Part - II - Intercepting traffic between WSO2 Carbon FE and BE'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-2000564434824019595</id><published>2010-11-18T20:10:00.000+05:30</published><updated>2010-11-18T20:10:16.699+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='Tools'/><title type='text'>Installing Wget on Mac OS X</title><content type='html'>1. Download from &lt;a href="http://ftp.gnu.org/pub/gnu/wget/wget-1.9.1.tar.gz"&gt;http://ftp.gnu.org/pub/gnu/wget/wget-1.9.1.tar.gz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2. cd ~/Downloads/wget-1.9.1&lt;br /&gt;&lt;br /&gt;3. ./configure&lt;br /&gt;&lt;br /&gt;4. make&lt;br /&gt;&lt;br /&gt;5. sudo make install&lt;br /&gt;&lt;br /&gt;6. wget http://dist.wso2.org/products/esb/java/3.0.1/wso2esb-3.0.1.zip&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-2000564434824019595?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/2000564434824019595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=2000564434824019595' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2000564434824019595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2000564434824019595'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/installing-wget-on-mac-os-x.html' title='Installing Wget on Mac OS X'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-7286390591068244301</id><published>2010-11-18T02:47:00.003+05:30</published><updated>2010-11-18T02:58:52.806+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='SSL'/><title type='text'>SSL Debugging - Part - I</title><content type='html'>We've been involved in many cases solving issues related to SSL.&lt;br /&gt;&lt;br /&gt;The latest one I came across was at a customer site, where WSO2 ESB wants to communicate with an          SSL end point(WCF) hosted on IIS 7.&lt;br /&gt;&lt;br /&gt;The only thing here what we have to do is, importing the CA certificate of the WCF end point to the ESB's client-trustore.jks [which is under ESB_HOME\resources\security].&lt;br /&gt;&lt;br /&gt;This worked well at the start - but in one machine it started to fail - with no clue at all..&lt;br /&gt;&lt;br /&gt;This is where we need some handy SSL debugging tools - and the easiest one is setting the system property javax.net.debug=all. For example you need to start the WSO2 ESB as,&lt;br /&gt;&lt;br /&gt;:\&gt; sh wso2server.sh &lt;b&gt;-Djavax.net.debug=all&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Once you set this, it will print the entire SSL handshake.&lt;br /&gt;&lt;br /&gt;By going through the logs, we could figure out the issue - where by mistake in this particular machine, in IIS, for this end point - 'Require SSL' being set to Accept, instead of Ignore.&lt;br /&gt;&lt;br /&gt;What does that mean.. and why did that fail..?&lt;br /&gt;&lt;br /&gt;When we set the above parameter to Accept, the server validates the client certificate only if it's been sent in the request from the client.&lt;br /&gt;&lt;br /&gt;In our case at the ESB end we set following two system properties,&lt;br /&gt;&lt;br /&gt;&lt;b&gt;System.setProperty("javax.net.ssl.keyStore", "keyStorePath");&lt;br /&gt;System.setProperty("javax.net.ssl.keyStorePassword", "password"); &lt;/b&gt;&lt;br /&gt;&lt;br /&gt;When you set these two, the client will automatically attach the client certificate to the SSL handshake - in our case it failed because we were not expecting mutual authentication, so IIS didn't trust ESB as a client.&lt;br /&gt;&lt;br /&gt;Another tool comes in handy while SSL debugging is openssl s_client.&lt;br /&gt;&lt;br /&gt;There was a case, where WSO2 ESB talking to an SSL end point behind an Apache server - in that case all the configuration options we provided didn't work - so the option left behind was to test the SSL setup of the Apache server in an independent manner - and proved us Apache server had issues in SSL setup. There we used openssl s_client. For example if you want to verify the SSL handshake with the end point, localhost:9443, you can use the following command.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;:\&gt;openssl s_client -connect localhost:9443  -state -nbio 2&gt;&amp;1 | grep "^SSL"&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The above will result in the following out put.&lt;pre name="code" class="html"&gt;SSL_connect:before/connect initialization&lt;br /&gt;SSL_connect:SSLv2/v3 write client hello A&lt;br /&gt;SSL_connect:error in SSLv2/v3 read server hello A&lt;br /&gt;SSL_connect:SSLv3 read server hello A&lt;br /&gt;SSL_connect:SSLv3 read server certificate A&lt;br /&gt;SSL_connect:SSLv3 read server key exchange A&lt;br /&gt;SSL_connect:SSLv3 read server done A&lt;br /&gt;SSL_connect:SSLv3 write client key exchange A&lt;br /&gt;SSL_connect:SSLv3 write change cipher spec A&lt;br /&gt;SSL_connect:SSLv3 write finished A&lt;br /&gt;SSL_connect:SSLv3 flush data&lt;br /&gt;SSL_connect:SSLv3 read finished A&lt;br /&gt;SSL handshake has read 1149 bytes and written 293 bytes&lt;br /&gt;SSL-Session:&lt;/pre&gt;To see all the options available with s_client, type the following,&lt;br /&gt;&lt;br /&gt;&lt;b&gt;:\&gt;openssl s_client  --help&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Let's finish off the first part of the SSL debugging series with &lt;a href="http://www.rtfm.com/ssldump/Ssldump.html"&gt;ssldump&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;ssldump is an SSL/TLS network protocol analyzer. It identifies TCP connections on the chosen network interface and attempts to interpret them as SSL/TLS traffic. When it identifies SSL/TLS traffic, it decodes the records and displays them in a textual form to stdout.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;:\&gt;sudo ssldump -i en1  port 443&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;The above prints following [only a part displayed], when I visit https://cloud.wso2.com.&lt;pre name="code" class="html"&gt;New TCP connection #1: 192.168.1.3(49986) &lt;-&gt; ec2-184-73-175-181.compute-1.amazonaws.com(443)&lt;br /&gt;1 1  0.3614 (0.3614)  C&gt;S  Handshake&lt;br /&gt;      ClientHello&lt;br /&gt;        Version 3.1 &lt;br /&gt;        cipher suites&lt;br /&gt;        Unknown value 0xc00a&lt;br /&gt;        Unknown value 0xc009&lt;br /&gt;        Unknown value 0xc007&lt;br /&gt;        Unknown value 0xc008&lt;br /&gt;        Unknown value 0xc013&lt;br /&gt;        Unknown value 0xc014&lt;br /&gt;        Unknown value 0xc011&lt;br /&gt;        Unknown value 0xc012&lt;br /&gt;        Unknown value 0xc004&lt;br /&gt;        Unknown value 0xc005&lt;br /&gt;        Unknown value 0xc002&lt;br /&gt;        Unknown value 0xc003&lt;br /&gt;        Unknown value 0xc00e&lt;br /&gt;        Unknown value 0xc00f&lt;br /&gt;        Unknown value 0xc00c&lt;br /&gt;        Unknown value 0xc00d&lt;br /&gt;        Unknown value 0x2f&lt;br /&gt;        TLS_RSA_WITH_RC4_128_SHA&lt;br /&gt;        TLS_RSA_WITH_RC4_128_MD5&lt;br /&gt;        Unknown value 0x35&lt;br /&gt;        TLS_RSA_WITH_3DES_EDE_CBC_SHA&lt;br /&gt;        TLS_RSA_WITH_DES_CBC_SHA&lt;br /&gt;        TLS_RSA_EXPORT_WITH_RC4_40_MD5&lt;br /&gt;        TLS_RSA_EXPORT_WITH_DES40_CBC_SHA&lt;br /&gt;        TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5&lt;br /&gt;        Unknown value 0x32&lt;br /&gt;        Unknown value 0x33&lt;br /&gt;        Unknown value 0x38&lt;br /&gt;        Unknown value 0x39&lt;br /&gt;        TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA&lt;br /&gt;        TLS_DHE_RSA_WITH_DES_CBC_SHA&lt;br /&gt;        TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA&lt;br /&gt;        TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA&lt;br /&gt;        TLS_DHE_DSS_WITH_DES_CBC_SHA&lt;br /&gt;        TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA&lt;br /&gt;        compression methods&lt;br /&gt;                  NULL&lt;br /&gt;1 2  0.7638 (0.4023)  S&gt;C  Handshake&lt;br /&gt;      ServerHello&lt;br /&gt;        Version 3.1 &lt;br /&gt;        session_id[32]=&lt;br /&gt;          22 24 f7 6c 43 84 ba 39 6f b9 02 5c 4d 76 cf 97 &lt;br /&gt;          ad b4 39 1b 82 fe c1 cf d7 5b 14 41 87 bd 6a 81 &lt;br /&gt;        cipherSuite         Unknown value 0x2f&lt;br /&gt;        compressionMethod                   NULL&lt;br /&gt;1 3  1.1691 (0.4053)  S&gt;C  Handshake&lt;br /&gt;      Certificate&lt;br /&gt;1 4  1.1691 (0.0000)  S&gt;C  Handshake&lt;br /&gt;      ServerHelloDone&lt;br /&gt;1 5  1.1749 (0.0058)  C&gt;S  Handshake&lt;br /&gt;      ClientKeyExchange&lt;br /&gt;1 6  1.1749 (0.0000)  C&gt;S  ChangeCipherSpec&lt;br /&gt;1 7  1.1750 (0.0000)  C&gt;S  Handshake&lt;br /&gt;1 8  1.5787 (0.4037)  S&gt;C  ChangeCipherSpec&lt;br /&gt;1 9  1.5787 (0.0000)  S&gt;C  Handshake&lt;br /&gt;1 10 1.5794 (0.0006)  C&gt;S  application_data&lt;br /&gt;1 11 2.1889 (0.6095)  S&gt;C  application_data&lt;br /&gt;1 12 2.1889 (0.0000)  S&gt;C  application_data&lt;br /&gt;1 13 2.1889 (0.0000)  S&gt;C  application_data&lt;br /&gt;1 14 2.1889 (0.0000)  S&gt;C  application_data&lt;br /&gt;1 15 2.1889 (0.0000)  S&gt;C  application_data&lt;br /&gt;1 16 2.1889 (0.0000)  S&gt;C  application_data&lt;br /&gt;1 17 2.1889 (0.0000)  S&gt;C  application_data&lt;br /&gt;1 18 2.1889 (0.0000)  S&gt;C  application_data&lt;br /&gt;1 19 2.1896 (0.0007)  C&gt;S  Alert&lt;br /&gt;1    2.1902 (0.0005)  C&gt;S  TCP FIN&lt;br /&gt;New TCP connection #2: 192.168.1.3(49987) &lt;-&gt; ec2-184-73-175-181.compute-1.amazonaws.com(443)&lt;br /&gt;2 1  0.3662 (0.3662)  C&gt;S  Handshake&lt;br /&gt;      ClientHello&lt;br /&gt;        Version 3.1 &lt;br /&gt;        resume [32]=&lt;br /&gt;          22 24 f7 6c 43 84 ba 39 6f b9 02 5c 4d 76 cf 97 &lt;br /&gt;          ad b4 39 1b 82 fe c1 cf d7 5b 14 41 87 bd 6a 81 &lt;br /&gt;        cipher suites&lt;br /&gt;        Unknown value 0xc00a&lt;br /&gt;        Unknown value 0xc009&lt;br /&gt;        Unknown value 0xc007&lt;br /&gt;        Unknown value 0xc008&lt;br /&gt;        Unknown value 0xc013&lt;br /&gt;        Unknown value 0xc014&lt;br /&gt;        Unknown value 0xc011&lt;br /&gt;        Unknown value 0xc012&lt;br /&gt;        Unknown value 0xc004&lt;br /&gt;        Unknown value 0xc005&lt;br /&gt;        Unknown value 0xc002&lt;br /&gt;        Unknown value 0xc003&lt;br /&gt;        Unknown value 0xc00e&lt;br /&gt;        Unknown value 0xc00f&lt;br /&gt;        Unknown value 0xc00c&lt;br /&gt;        Unknown value 0xc00d&lt;br /&gt;        Unknown value 0x2f&lt;br /&gt;        TLS_RSA_WITH_RC4_128_SHA&lt;br /&gt;        TLS_RSA_WITH_RC4_128_MD5&lt;br /&gt;        Unknown value 0x35&lt;br /&gt;        TLS_RSA_WITH_3DES_EDE_CBC_SHA&lt;br /&gt;        TLS_RSA_WITH_DES_CBC_SHA&lt;br /&gt;        TLS_RSA_EXPORT_WITH_RC4_40_MD5&lt;br /&gt;        TLS_RSA_EXPORT_WITH_DES40_CBC_SHA&lt;br /&gt;        TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5&lt;br /&gt;        Unknown value 0x32&lt;br /&gt;        Unknown value 0x33&lt;br /&gt;        Unknown value 0x38&lt;br /&gt;        Unknown value 0x39&lt;br /&gt;        TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA&lt;br /&gt;        TLS_DHE_RSA_WITH_DES_CBC_SHA&lt;br /&gt;        TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA&lt;br /&gt;        TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA&lt;br /&gt;        TLS_DHE_DSS_WITH_DES_CBC_SHA&lt;br /&gt;        TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA&lt;br /&gt;        compression methods&lt;br /&gt;                  NULL&lt;br /&gt;2 2  0.9732 (0.6070)  S&gt;C  Handshake&lt;br /&gt;      ServerHello&lt;br /&gt;        Version 3.1 &lt;br /&gt;        session_id[32]=&lt;br /&gt;          22 24 f7 6c 43 84 ba 39 6f b9 02 5c 4d 76 cf 97 &lt;br /&gt;          ad b4 39 1b 82 fe c1 cf d7 5b 14 41 87 bd 6a 81 &lt;br /&gt;        cipherSuite         Unknown value 0x2f&lt;br /&gt;        compressionMethod                   NULL&lt;br /&gt;2 3  0.9732 (0.0000)  S&gt;C  ChangeCipherSpec&lt;br /&gt;2 4  0.9732 (0.0000)  S&gt;C  Handshake&lt;br /&gt;2 5  0.9735 (0.0003)  C&gt;S  ChangeCipherSpec&lt;br /&gt;2 6  0.9736 (0.0000)  C&gt;S  Handshake&lt;br /&gt;2 7  0.9737 (0.0001)  C&gt;S  application_data&lt;br /&gt;2 8  1.6900 (0.7162)  S&gt;C  application_data&lt;br /&gt;2 9  1.6900 (0.0000)  S&gt;C  application_data&lt;br /&gt;2 10 1.6900 (0.0000)  S&gt;C  application_data&lt;br /&gt;2 11 1.6900 (0.0000)  S&gt;C  application_data&lt;br /&gt;2 12 1.6900 (0.0000)  S&gt;C  application_data&lt;br /&gt;2 13 1.6900 (0.0000)  S&gt;C  application_data&lt;br /&gt;2 14 1.6900 (0.0000)  S&gt;C  application_data&lt;br /&gt;2 15 1.6900 (0.0000)  S&gt;C  application_data&lt;br /&gt;2 16 1.6903 (0.0002)  C&gt;S  Alert&lt;br /&gt;2    1.6909 (0.0006)  C&gt;S  TCP FIN&lt;br /&gt;New TCP connection #3: 192.168.1.3(49988) &lt;-&gt; ec2-184-73-175-181.compute-1.amazonaws.com(443)&lt;br /&gt;3 1  0.3674 (0.3674)  C&gt;S  Handshake&lt;br /&gt;      ClientHello&lt;br /&gt;        Version 3.1 &lt;br /&gt;        resume [32]=&lt;br /&gt;          22 24 f7 6c 43 84 ba 39 6f b9 02 5c 4d 76 cf 97 &lt;br /&gt;          ad b4 39 1b 82 fe c1 cf d7 5b 14 41 87 bd 6a 81 &lt;br /&gt;        cipher suites&lt;br /&gt;        Unknown value 0xc00a&lt;br /&gt;        Unknown value 0xc009&lt;br /&gt;        Unknown value 0xc007&lt;br /&gt;        Unknown value 0xc008&lt;br /&gt;        Unknown value 0xc013&lt;br /&gt;        Unknown value 0xc014&lt;br /&gt;        Unknown value 0xc011&lt;br /&gt;        Unknown value 0xc012&lt;br /&gt;        Unknown value 0xc004&lt;br /&gt;        Unknown value 0xc005&lt;br /&gt;        Unknown value 0xc002&lt;br /&gt;        Unknown value 0xc003&lt;br /&gt;        Unknown value 0xc00e&lt;br /&gt;        Unknown value 0xc00f&lt;br /&gt;        Unknown value 0xc00c&lt;br /&gt;        Unknown value 0xc00d&lt;br /&gt;        Unknown value 0x2f&lt;br /&gt;        TLS_RSA_WITH_RC4_128_SHA&lt;br /&gt;        TLS_RSA_WITH_RC4_128_MD5&lt;br /&gt;        Unknown value 0x35&lt;br /&gt;        TLS_RSA_WITH_3DES_EDE_CBC_SHA&lt;br /&gt;        TLS_RSA_WITH_DES_CBC_SHA&lt;br /&gt;        TLS_RSA_EXPORT_WITH_RC4_40_MD5&lt;br /&gt;        TLS_RSA_EXPORT_WITH_DES40_CBC_SHA&lt;br /&gt;        TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5&lt;br /&gt;        Unknown value 0x32&lt;br /&gt;        Unknown value 0x33&lt;br /&gt;        Unknown value 0x38&lt;br /&gt;        Unknown value 0x39&lt;br /&gt;        TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA&lt;br /&gt;        TLS_DHE_RSA_WITH_DES_CBC_SHA&lt;br /&gt;        TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA&lt;br /&gt;        TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA&lt;br /&gt;        TLS_DHE_DSS_WITH_DES_CBC_SHA&lt;br /&gt;        TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA&lt;br /&gt;        compression methods&lt;br /&gt;                  NULL&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-7286390591068244301?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/7286390591068244301/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=7286390591068244301' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7286390591068244301'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7286390591068244301'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/debugging-ssl-connections-part-i.html' title='SSL Debugging - Part - I'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-1128274813233737028</id><published>2010-11-13T21:01:00.004+05:30</published><updated>2010-11-13T21:11:27.493+05:30</updated><title type='text'>Forgot My Password</title><content type='html'>Almost all online services provide a way to recover your password, in case you forget it.&lt;br /&gt;&lt;br /&gt;&lt;img src="http://cache.facilelogin.com/i-forgot-my-password.jpg" /&gt;&lt;br /&gt;&lt;br /&gt;And this is the first thing a hacker will look into, to gain control of your account.... so, this is something we need to design carefully...&lt;br /&gt;&lt;br /&gt;Let's look at different ways this feature being implemented by major online service providers..&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Secret Questions with Yahoo&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;- You need to set your Secret Questions at the time you sign up - and later you can change if you wish&lt;br /&gt;- But - you need to make sure you set strong secret questions for the first time - if you set weaker ones there your account can be compromised at any time - even you change it later..&lt;br /&gt;- Make sure answers to your secret questions cannot be found via any of your social networking profiles..&lt;br /&gt;- What if somebody gain control of your account via the secret questions? and later change the original secret questions to a different set&lt;br /&gt;- Yahoo still let you gain the control back&lt;br /&gt;- You can go through 'Forgot Password' flow and ask for your original secret questions [not the ones the attacker did set]&lt;br /&gt;- Then you can gain access to your account, but you will never be able to change the original secret questions, so if the attacker knows the original, he can comeback anytime and get the control of your account once again.&lt;br /&gt;- A captcha being used&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Password reset link to the email with Google&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;- You need to have a secondary email address registered&lt;br /&gt;- Secondary email address is not shown to the user during the process of password recovery&lt;br /&gt;- Password reset link being sent to the secondary email address and that link is valid only for a limited time frame&lt;br /&gt;- Even though the password recovery link being sent - still the user can login with the original password, if resetting was not done&lt;br /&gt;- No temporary passwords generated&lt;br /&gt;- Once the password resetting initiated a mail being also sent to the original email address, so if this is an attacker who is doing this, the actual owner of the email account get to know something is going on&lt;br /&gt;- A captcha being used&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Password reset code with Facebook&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;- You need to have either an email address or mobile number registered with your account&lt;br /&gt;- Once you initiate password resetting process, a code will be sent to you&lt;br /&gt;- You need confirm the receipt of the confirmation code to reset the password&lt;br /&gt;- Till you reset the password, you can use the original password to login&lt;br /&gt;- No captcha being used&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Password reset link to the email with Twitter&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;- Need to have an email address registered&lt;br /&gt;- Password reset link being sent to the email address and that link is valid only for a limited time frame&lt;br /&gt;- Even though the password recovery link being sent - still the user can login with the original password, if resetting was not done&lt;br /&gt;- No temporary passwords generated&lt;br /&gt;- No captcha being used&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Original password sent back to the email&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;- Forget them, they store your passwords in clear text&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Generate a temporary password and send back to the email&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;- This is better than the previous one&lt;br /&gt;- Since the original password being replaced by the temporary one, if initiated by an attacker, the true owner won't be able to login till he rest again or check his email&lt;br /&gt;- Should be protected with a captcha&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-1128274813233737028?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/1128274813233737028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=1128274813233737028' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1128274813233737028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/1128274813233737028'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/forgot-my-password.html' title='Forgot My Password'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-7707120709472981874</id><published>2010-11-11T17:53:00.000+05:30</published><updated>2010-11-11T17:53:51.376+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='XACML'/><title type='text'>.NET Client / Web App - Authorization with WSO2 Identity Server, XACML Engine</title><content type='html'>1. Download the WSO2 Identity Server 3.0.1 from &lt;a href="http://wso2.com/products/identity-server/"&gt;http://wso2.com/products/identity-server/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2. Start the Identity Server and go to https://localhost:9443/carbon - then go to Policies --&gt; Entitlement and add a new XACML Policy - then replace the default one with the one below.&lt;br /&gt;&lt;br /&gt;The XACML policy below addresses following authorization requirements.&lt;br /&gt;&lt;br /&gt;- The operation getVesrion1 and getVersion2 in the service /services/Customers should be accessed by any user&lt;br /&gt;&lt;br /&gt;- Request to any other service or operation should only be accessed by the users belong to the group(s) admin_emps or admin or both&lt;pre name="code" class="html"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;br /&gt;&amp;lt;Policy PolicyId="urn:sample:xacml:2.0:samplepolicy"&lt;br /&gt;  RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" xmlns="urn:oasis:names:tc:xacml:2.0:policy:schema:os"&gt;&lt;br /&gt;  &amp;lt;Description&gt;Sample XACML Authorization Policy&amp;lt;/Description&gt;&lt;br /&gt;  &amp;lt;Target&gt;&lt;br /&gt;    &amp;lt;Subjects&gt;&lt;br /&gt;      &amp;lt;AnySubject/&gt;&lt;br /&gt;    &amp;lt;/Subjects&gt;&lt;br /&gt;    &amp;lt;Actions&gt;&lt;br /&gt;      &amp;lt;AnyAction/&gt;&lt;br /&gt;    &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;Resources&gt;&lt;br /&gt;      &amp;lt;AnyResource/&gt;&lt;br /&gt;    &amp;lt;/Resources&gt;&lt;br /&gt;  &amp;lt;/Target&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Permit" RuleId="primary-resource-rule"&gt;&lt;br /&gt;    &amp;lt;Target&gt;&lt;br /&gt;      &amp;lt;Subjects&gt;&lt;br /&gt;        &amp;lt;AnySubject/&gt;&lt;br /&gt;      &amp;lt;/Subjects&gt;&lt;br /&gt;      &amp;lt;Resources&gt;&lt;br /&gt;        &amp;lt;ResourceMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of"&gt;&lt;br /&gt;          &amp;lt;ResourceAttributeDesignator&lt;br /&gt;            AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;          &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;/services/Customers/getVersion1&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;/services/Customers/getVersion2&amp;lt;/AttributeValue&gt;&lt;br /&gt;          &amp;lt;/Apply&gt;&lt;br /&gt;        &amp;lt;/ResourceMatch&gt;&lt;br /&gt;      &amp;lt;/Resources&gt;&lt;br /&gt;      &amp;lt;Actions&gt;&lt;br /&gt;        &amp;lt;AnyAction/&gt;&lt;br /&gt;      &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;/Target&gt;&lt;br /&gt;    &amp;lt;Condition&gt;&lt;br /&gt;      &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of"&gt;&lt;br /&gt;        &amp;lt;ResourceAttributeDesignator&lt;br /&gt;          AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;        &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;/services/Customers/getVersion1&amp;lt;/AttributeValue&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;/services/Customers/getVersion2&amp;lt;/AttributeValue&gt;&lt;br /&gt;        &amp;lt;/Apply&gt;&lt;br /&gt;      &amp;lt;/Apply&gt;&lt;br /&gt;    &amp;lt;/Condition&gt;&lt;br /&gt;  &amp;lt;/Rule&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Permit" RuleId="primary-group-emps-rule"&gt;&lt;br /&gt;    &amp;lt;Target&gt;&lt;br /&gt;      &amp;lt;Subjects&gt;&lt;br /&gt;        &amp;lt;AnySubject/&gt;&lt;br /&gt;      &amp;lt;/Subjects&gt;&lt;br /&gt;      &amp;lt;Resources&gt;&lt;br /&gt;        &amp;lt;Resource&gt;&lt;br /&gt;          &amp;lt;ResourceMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;/services/Customers/&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;ResourceAttributeDesignator&lt;br /&gt;              AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;          &amp;lt;/ResourceMatch&gt;&lt;br /&gt;        &amp;lt;/Resource&gt;&lt;br /&gt;      &amp;lt;/Resources&gt;&lt;br /&gt;      &amp;lt;Actions&gt;&lt;br /&gt;        &amp;lt;Action&gt;&lt;br /&gt;          &amp;lt;ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;read&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;ActionAttributeDesignator&lt;br /&gt;              AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;          &amp;lt;/ActionMatch&gt;&lt;br /&gt;        &amp;lt;/Action&gt;&lt;br /&gt;      &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;/Target&gt;&lt;br /&gt;    &amp;lt;Condition&gt;&lt;br /&gt;      &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of"&gt;&lt;br /&gt;        &amp;lt;SubjectAttributeDesignator AttributeId="group" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;        &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin_emps&amp;lt;/AttributeValue&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin&amp;lt;/AttributeValue&gt;&lt;br /&gt;        &amp;lt;/Apply&gt;&lt;br /&gt;      &amp;lt;/Apply&gt;&lt;br /&gt;    &amp;lt;/Condition&gt;&lt;br /&gt;  &amp;lt;/Rule&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Deny" RuleId="deny-rule"/&gt;&lt;br /&gt;&amp;lt;/Policy&gt;&lt;/pre&gt;&lt;br /&gt;3. Download the .NET client from &lt;a href="http://cache.facilelogin.com/wcf-entitlement-client.zip"&gt;hear&lt;/a&gt; - unzip it - edit the app.config to point to correct EPRs where your Identity Server [XACML engine] is running.&lt;br /&gt;&lt;br /&gt;4. You can parse the XML response returned from the XACMl engine to get the decision.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-7707120709472981874?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/7707120709472981874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=7707120709472981874' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7707120709472981874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7707120709472981874'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/net-client-web-app-authorization-with.html' title='.NET Client / Web App - Authorization with WSO2 Identity Server, XACML Engine'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-7102742962490750592</id><published>2010-11-11T10:25:00.001+05:30</published><updated>2010-11-11T10:28:59.733+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='XACML'/><title type='text'>Guide to write XACML policies in WSO2 Identity Server - Part - 7</title><content type='html'>This blog post is a follow up to the &lt;a href="http://blog.facilelogin.com/2010/11/guide-to-write-xacml-policies-in-wso2_8662.html"&gt;Guide to write XACML policies in WSO2 Identity Server - Part - 6&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This post addresses following authorization requirements.&lt;br /&gt;&lt;br /&gt;1. The operation getVesrion1 and getVersion2 in the service http://localhost:8280/services/Customers should be accessed by any user&lt;br /&gt;&lt;br /&gt;2. Request to any other service or operation should only be accessed by the users belong to the group(s) admin_emps or admin or both&lt;pre name="code" class="html"&gt;&amp;lt;Policy PolicyId="urn:sample:xacml:2.0:samplepolicy"&lt;br /&gt;  RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" xmlns="urn:oasis:names:tc:xacml:2.0:policy:schema:os"&gt;&lt;br /&gt;  &amp;lt;Description&gt;Sample XACML Authorization Policy&amp;lt;/Description&gt;&lt;br /&gt;  &amp;lt;Target&gt;&lt;br /&gt;    &amp;lt;Subjects&gt;&lt;br /&gt;      &amp;lt;AnySubject/&gt;&lt;br /&gt;    &amp;lt;/Subjects&gt;&lt;br /&gt;    &amp;lt;Actions&gt;&lt;br /&gt;      &amp;lt;AnyAction/&gt;&lt;br /&gt;    &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;Resources&gt;&lt;br /&gt;      &amp;lt;AnyResource/&gt;&lt;br /&gt;    &amp;lt;/Resources&gt;&lt;br /&gt;  &amp;lt;/Target&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Permit" RuleId="primary-resource-rule"&gt;&lt;br /&gt;    &amp;lt;Target&gt;&lt;br /&gt;      &amp;lt;Subjects&gt;&lt;br /&gt;        &amp;lt;AnySubject/&gt;&lt;br /&gt;      &amp;lt;/Subjects&gt;&lt;br /&gt;      &amp;lt;Resources&gt;&lt;br /&gt;        &amp;lt;ResourceMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of"&gt;&lt;br /&gt;          &amp;lt;ResourceAttributeDesignator&lt;br /&gt;            AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;          &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;http://localhost:8280/services/Customers/getVersion1&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;http://localhost:8280/services/Customers/getVersion2&amp;lt;/AttributeValue&gt;&lt;br /&gt;          &amp;lt;/Apply&gt;&lt;br /&gt;        &amp;lt;/ResourceMatch&gt;&lt;br /&gt;      &amp;lt;/Resources&gt;&lt;br /&gt;      &amp;lt;Actions&gt;&lt;br /&gt;        &amp;lt;AnyAction/&gt;&lt;br /&gt;      &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;/Target&gt;&lt;br /&gt;    &amp;lt;Condition&gt;&lt;br /&gt;      &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of"&gt;&lt;br /&gt;        &amp;lt;ResourceAttributeDesignator&lt;br /&gt;          AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;        &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;http://localhost:8280/services/Customers/getVersion1&amp;lt;/AttributeValue&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;http://localhost:8280/services/Customers/getVersion2&amp;lt;/AttributeValue&gt;&lt;br /&gt;        &amp;lt;/Apply&gt;&lt;br /&gt;      &amp;lt;/Apply&gt;&lt;br /&gt;    &amp;lt;/Condition&gt;&lt;br /&gt;  &amp;lt;/Rule&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Permit" RuleId="primary-group-emps-rule"&gt;&lt;br /&gt;    &amp;lt;Target&gt;&lt;br /&gt;      &amp;lt;Subjects&gt;&lt;br /&gt;        &amp;lt;AnySubject/&gt;&lt;br /&gt;      &amp;lt;/Subjects&gt;&lt;br /&gt;      &amp;lt;Resources&gt;&lt;br /&gt;          &amp;lt;AnyResource/&gt;&lt;br /&gt;      &amp;lt;/Resources&gt;&lt;br /&gt;      &amp;lt;Actions&gt;&lt;br /&gt;        &amp;lt;Action&gt;&lt;br /&gt;          &amp;lt;ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;read&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;ActionAttributeDesignator&lt;br /&gt;              AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;          &amp;lt;/ActionMatch&gt;&lt;br /&gt;        &amp;lt;/Action&gt;&lt;br /&gt;      &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;/Target&gt;&lt;br /&gt;    &amp;lt;Condition&gt;&lt;br /&gt;      &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of"&gt;&lt;br /&gt;        &amp;lt;SubjectAttributeDesignator AttributeId="group" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;        &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin_emps&amp;lt;/AttributeValue&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin&amp;lt;/AttributeValue&gt;&lt;br /&gt;        &amp;lt;/Apply&gt;&lt;br /&gt;      &amp;lt;/Apply&gt;&lt;br /&gt;    &amp;lt;/Condition&gt;&lt;br /&gt;  &amp;lt;/Rule&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Deny" RuleId="deny-rule"/&gt;&lt;br /&gt;&amp;lt;/Policy&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-7102742962490750592?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/7102742962490750592/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=7102742962490750592' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7102742962490750592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7102742962490750592'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/guide-to-write-xacml-policies-in-wso2_3615.html' title='Guide to write XACML policies in WSO2 Identity Server - Part - 7'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-2607002338266360913</id><published>2010-11-11T09:28:00.001+05:30</published><updated>2010-11-11T09:31:24.253+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='XACML'/><title type='text'>Guide to write XACML policies in WSO2 Identity Server - Part - 6</title><content type='html'>This blog post is a follow up to the &lt;a href="http://blog.facilelogin.com/2010/11/guide-to-write-xacml-policies-in-wso2_7417.html"&gt;Guide to write XACML policies in WSO2 Identity Server - Part - 5&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This post addresses following authorization requirements.&lt;br /&gt;&lt;br /&gt;1. The operation getEmployees in the service http://localhost:8280/services/Customers should only be accessed by the users belong to the group(s) admin_emps or admin or both&lt;br /&gt;&lt;br /&gt;2. Request to any other service or operation should fail&lt;br /&gt;&lt;br /&gt;3. But the users admin1 and admin2 should be able to access any resource irrespective of their role&lt;pre name="code" class="html"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;br /&gt;&amp;lt;Policy PolicyId="urn:sample:xacml:2.0:samplepolicy"&lt;br /&gt;  RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" xmlns="urn:oasis:names:tc:xacml:2.0:policy:schema:os"&gt;&lt;br /&gt;  &amp;lt;Description&gt;Sample XACML Authorization Policy&amp;lt;/Description&gt;&lt;br /&gt;  &amp;lt;Target&gt;&lt;br /&gt;    &amp;lt;Subjects&gt;&lt;br /&gt;      &amp;lt;AnySubject/&gt;&lt;br /&gt;    &amp;lt;/Subjects&gt;&lt;br /&gt;    &amp;lt;Actions&gt;&lt;br /&gt;      &amp;lt;AnyAction/&gt;&lt;br /&gt;    &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;Resources&gt;&lt;br /&gt;      &amp;lt;AnyResource/&gt;&lt;br /&gt;    &amp;lt;/Resources&gt;&lt;br /&gt;  &amp;lt;/Target&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Permit" RuleId="primary-user-rule"&gt;&lt;br /&gt;    &amp;lt;Target&gt;&lt;br /&gt;      &amp;lt;Subjects&gt;&lt;br /&gt;        &amp;lt;SubjectMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of"&gt;&lt;br /&gt;          &amp;lt;SubjectAttributeDesignator&lt;br /&gt;            AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id"&lt;br /&gt;            DataType="http://www.w3.org/2001/XMLSchema#string" SubjectCategory="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"/&gt;&lt;br /&gt;          &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin1&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin2&amp;lt;/AttributeValue&gt;&lt;br /&gt;          &amp;lt;/Apply&gt;&lt;br /&gt;        &amp;lt;/SubjectMatch&gt;&lt;br /&gt;      &amp;lt;/Subjects&gt;&lt;br /&gt;      &amp;lt;Resources&gt;&lt;br /&gt;        &amp;lt;AnyResource/&gt;&lt;br /&gt;      &amp;lt;/Resources&gt;&lt;br /&gt;      &amp;lt;Actions&gt;&lt;br /&gt;        &amp;lt;AnyAction/&gt;&lt;br /&gt;      &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;/Target&gt;&lt;br /&gt;    &amp;lt;Condition&gt;&lt;br /&gt;      &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of"&gt;&lt;br /&gt;        &amp;lt;SubjectAttributeDesignator&lt;br /&gt;          AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;        &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin1&amp;lt;/AttributeValue&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin2&amp;lt;/AttributeValue&gt;&lt;br /&gt;        &amp;lt;/Apply&gt;&lt;br /&gt;      &amp;lt;/Apply&gt;&lt;br /&gt;    &amp;lt;/Condition&gt;&lt;br /&gt;  &amp;lt;/Rule&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Permit" RuleId="primary-group-emps-rule"&gt;&lt;br /&gt;    &amp;lt;Target&gt;&lt;br /&gt;      &amp;lt;Subjects&gt;&lt;br /&gt;        &amp;lt;AnySubject/&gt;&lt;br /&gt;      &amp;lt;/Subjects&gt;&lt;br /&gt;      &amp;lt;Resources&gt;&lt;br /&gt;        &amp;lt;Resource&gt;&lt;br /&gt;          &amp;lt;ResourceMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;http://localhost:8280/services/Customers/getEmployees&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;ResourceAttributeDesignator&lt;br /&gt;              AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;          &amp;lt;/ResourceMatch&gt;&lt;br /&gt;        &amp;lt;/Resource&gt;&lt;br /&gt;      &amp;lt;/Resources&gt;&lt;br /&gt;      &amp;lt;Actions&gt;&lt;br /&gt;        &amp;lt;Action&gt;&lt;br /&gt;          &amp;lt;ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;read&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;ActionAttributeDesignator&lt;br /&gt;              AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;          &amp;lt;/ActionMatch&gt;&lt;br /&gt;        &amp;lt;/Action&gt;&lt;br /&gt;      &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;/Target&gt;&lt;br /&gt;    &amp;lt;Condition&gt;&lt;br /&gt;      &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of"&gt;&lt;br /&gt;        &amp;lt;SubjectAttributeDesignator AttributeId="group" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;        &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin_emps&amp;lt;/AttributeValue&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin&amp;lt;/AttributeValue&gt;&lt;br /&gt;        &amp;lt;/Apply&gt;&lt;br /&gt;      &amp;lt;/Apply&gt;&lt;br /&gt;    &amp;lt;/Condition&gt;&lt;br /&gt;  &amp;lt;/Rule&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Deny" RuleId="deny-rule"/&gt;&lt;br /&gt;&amp;lt;/Policy&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-2607002338266360913?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/2607002338266360913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=2607002338266360913' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2607002338266360913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/2607002338266360913'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/guide-to-write-xacml-policies-in-wso2_8662.html' title='Guide to write XACML policies in WSO2 Identity Server - Part - 6'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-8909844178585372388</id><published>2010-11-11T03:22:00.002+05:30</published><updated>2010-11-11T09:09:01.362+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='XACML'/><title type='text'>Guide to write XACML policies in WSO2 Identity Server - Part - 5</title><content type='html'>This blog post is a follow up to the &lt;a href="http://blog.facilelogin.com/2010/11/guide-to-write-xacml-policies-in-wso2_4005.html"&gt;Guide to write XACML policies in WSO2 Identity Server - Part - 4&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This posts addresses following authorization requirements.&lt;br /&gt;&lt;br /&gt;1. The operation getEmployees in the service http://localhost:8280/services/Customers should only be accessed by the users belong to the group(s) admin_emps or admin or both&lt;br /&gt;&lt;br /&gt;2. Request to any other service or operation should fail&lt;pre name="code" class="html"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;br /&gt;&amp;lt;Policy PolicyId="urn:sample:xacml:2.0:samplepolicy"&lt;br /&gt;  RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" xmlns="urn:oasis:names:tc:xacml:2.0:policy:schema:os"&gt;&lt;br /&gt;  &amp;lt;Description&gt;Sample XACML Authorization Policy&amp;lt;/Description&gt;&lt;br /&gt;  &amp;lt;Target&gt;&lt;br /&gt;    &amp;lt;Subjects&gt;&lt;br /&gt;      &amp;lt;AnySubject/&gt;&lt;br /&gt;    &amp;lt;/Subjects&gt;&lt;br /&gt;    &amp;lt;Actions&gt;&lt;br /&gt;      &amp;lt;AnyAction/&gt;&lt;br /&gt;    &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;Resources&gt;&lt;br /&gt;      &amp;lt;AnyResource/&gt;&lt;br /&gt;    &amp;lt;/Resources&gt;&lt;br /&gt;  &amp;lt;/Target&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Permit" RuleId="primary-group-emps-rule"&gt;&lt;br /&gt;    &amp;lt;Target&gt;&lt;br /&gt;      &amp;lt;Subjects&gt;&lt;br /&gt;        &amp;lt;AnySubject/&gt;&lt;br /&gt;      &amp;lt;/Subjects&gt;&lt;br /&gt;      &amp;lt;Resources&gt;&lt;br /&gt;        &amp;lt;Resource&gt;&lt;br /&gt;          &amp;lt;ResourceMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;http://localhost:8280/services/Customers/getEmployees&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;ResourceAttributeDesignator&lt;br /&gt;              AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;          &amp;lt;/ResourceMatch&gt;&lt;br /&gt;        &amp;lt;/Resource&gt;&lt;br /&gt;      &amp;lt;/Resources&gt;&lt;br /&gt;      &amp;lt;Actions&gt;&lt;br /&gt;        &amp;lt;Action&gt;&lt;br /&gt;          &amp;lt;ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;read&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;ActionAttributeDesignator&lt;br /&gt;              AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;          &amp;lt;/ActionMatch&gt;&lt;br /&gt;        &amp;lt;/Action&gt;&lt;br /&gt;      &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;/Target&gt;&lt;br /&gt;    &amp;lt;Condition&gt;&lt;br /&gt;      &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-at-least-one-member-of"&gt;&lt;br /&gt;        &amp;lt;SubjectAttributeDesignator AttributeId="group" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;        &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin_emps&amp;lt;/AttributeValue&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin&amp;lt;/AttributeValue&gt;&lt;br /&gt;        &amp;lt;/Apply&gt;&lt;br /&gt;      &amp;lt;/Apply&gt;&lt;br /&gt;    &amp;lt;/Condition&gt;&lt;br /&gt;  &amp;lt;/Rule&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Deny" RuleId="deny-rule"/&gt;&lt;br /&gt;&amp;lt;/Policy&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-8909844178585372388?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/8909844178585372388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=8909844178585372388' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8909844178585372388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/8909844178585372388'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/guide-to-write-xacml-policies-in-wso2_7417.html' title='Guide to write XACML policies in WSO2 Identity Server - Part - 5'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-7952524798039412103</id><published>2010-11-11T03:07:00.003+05:30</published><updated>2010-11-11T09:06:38.017+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='XACML'/><title type='text'>Guide to write XACML policies in WSO2 Identity Server - Part - 4</title><content type='html'>This blog post is a follow up to the &lt;a href="http://blog.facilelogin.com/2010/11/guide-to-write-xacml-policies-in-wso2_11.html"&gt;Guide to write XACML policies in WSO2 Identity Server - Part - 3&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This post addresses following authorization requirements.&lt;br /&gt;&lt;br /&gt;1. The operation getEmployees in the service http://localhost:8280/services/Customers should only be accessed by the users belong to both the groups admin_emps and admin&lt;br /&gt;&lt;br /&gt;2. If the user belongs to more groups than admin_emps and admin - request should fail&lt;br /&gt;&lt;br /&gt;3. Request to any other service or operation should fail&lt;pre name="code" class="html"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;br /&gt;&amp;lt;Policy PolicyId="urn:sample:xacml:2.0:samplepolicy"&lt;br /&gt;  RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" xmlns="urn:oasis:names:tc:xacml:2.0:policy:schema:os"&gt;&lt;br /&gt;  &amp;lt;Description&gt;Sample XACML Authorization Policy&amp;lt;/Description&gt;&lt;br /&gt;  &amp;lt;Target&gt;&lt;br /&gt;    &amp;lt;Subjects&gt;&lt;br /&gt;      &amp;lt;AnySubject/&gt;&lt;br /&gt;    &amp;lt;/Subjects&gt;&lt;br /&gt;    &amp;lt;Actions&gt;&lt;br /&gt;      &amp;lt;AnyAction/&gt;&lt;br /&gt;    &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;Resources&gt;&lt;br /&gt;      &amp;lt;AnyResource/&gt;&lt;br /&gt;    &amp;lt;/Resources&gt;&lt;br /&gt;  &amp;lt;/Target&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Permit" RuleId="primary-group-emps-rule"&gt;&lt;br /&gt;    &amp;lt;Target&gt;&lt;br /&gt;      &amp;lt;Subjects&gt;&lt;br /&gt;        &amp;lt;AnySubject/&gt;&lt;br /&gt;      &amp;lt;/Subjects&gt;&lt;br /&gt;      &amp;lt;Resources&gt;&lt;br /&gt;        &amp;lt;Resource&gt;&lt;br /&gt;          &amp;lt;ResourceMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;http://localhost:8280/services/Customers/getEmployees&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;ResourceAttributeDesignator&lt;br /&gt;              AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;          &amp;lt;/ResourceMatch&gt;&lt;br /&gt;        &amp;lt;/Resource&gt;&lt;br /&gt;      &amp;lt;/Resources&gt;&lt;br /&gt;      &amp;lt;Actions&gt;&lt;br /&gt;        &amp;lt;Action&gt;&lt;br /&gt;          &amp;lt;ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;read&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;ActionAttributeDesignator&lt;br /&gt;              AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;          &amp;lt;/ActionMatch&gt;&lt;br /&gt;        &amp;lt;/Action&gt;&lt;br /&gt;      &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;/Target&gt;&lt;br /&gt;    &amp;lt;Condition&gt;&lt;br /&gt;      &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-set-equals"&gt;&lt;br /&gt;        &amp;lt;SubjectAttributeDesignator AttributeId="group" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;        &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin_emps&amp;lt;/AttributeValue&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin&amp;lt;/AttributeValue&gt;&lt;br /&gt;        &amp;lt;/Apply&gt;&lt;br /&gt;      &amp;lt;/Apply&gt;&lt;br /&gt;    &amp;lt;/Condition&gt;&lt;br /&gt;  &amp;lt;/Rule&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Deny" RuleId="deny-rule"/&gt;&lt;br /&gt;&amp;lt;/Policy&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-7952524798039412103?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/7952524798039412103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=7952524798039412103' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7952524798039412103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/7952524798039412103'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/guide-to-write-xacml-policies-in-wso2_4005.html' title='Guide to write XACML policies in WSO2 Identity Server - Part - 4'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-4384966288869131504</id><published>2010-11-11T02:05:00.004+05:30</published><updated>2010-11-11T09:05:50.822+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='XACML'/><title type='text'>Guide to write XACML policies in WSO2 Identity Server - Part - 3</title><content type='html'>This blog post is a follow up to the &lt;a href="http://blog.facilelogin.com/2010/11/guide-to-write-xacml-policies-in-wso2.html"&gt;Guide to write XACML policies in WSO2 Identity Server - Part - 2&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;This post addresses following authorization requirements.&lt;br /&gt;&lt;br /&gt;1. The operation getCustomers in the service http://localhost:8280/services/Customers should only be accessed by the users belong to group admin_customers&lt;br /&gt;&lt;br /&gt;2. The operation getEmployees in the service http://localhost:8280/services/Customers should only be accessed by the users belong to group admin_emps&lt;br /&gt;&lt;br /&gt;3. Request to any other service or operation should fail&lt;pre name="code" class="html"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;br /&gt;&amp;lt;Policy PolicyId="urn:sample:xacml:2.0:samplepolicy"&lt;br /&gt;  RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" xmlns="urn:oasis:names:tc:xacml:2.0:policy:schema:os"&gt;&lt;br /&gt;  &amp;lt;Description&gt;Sample XACML Authorization Policy&amp;lt;/Description&gt;&lt;br /&gt;  &amp;lt;Target&gt;&lt;br /&gt;    &amp;lt;Subjects&gt;&lt;br /&gt;      &amp;lt;AnySubject/&gt;&lt;br /&gt;    &amp;lt;/Subjects&gt;&lt;br /&gt;    &amp;lt;Actions&gt;&lt;br /&gt;      &amp;lt;AnyAction/&gt;&lt;br /&gt;    &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;Resources&gt;&lt;br /&gt;      &amp;lt;AnyResource/&gt;&lt;br /&gt;    &amp;lt;/Resources&gt;&lt;br /&gt;  &amp;lt;/Target&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Permit" RuleId="primary-group-customer-rule"&gt;&lt;br /&gt;    &amp;lt;Target&gt;&lt;br /&gt;      &amp;lt;Subjects&gt;&lt;br /&gt;        &amp;lt;AnySubject/&gt;&lt;br /&gt;      &amp;lt;/Subjects&gt;&lt;br /&gt;      &amp;lt;Resources&gt;&lt;br /&gt;        &amp;lt;Resource&gt;&lt;br /&gt;          &amp;lt;ResourceMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;http://localhost:8280/services/Customers/getCustomers&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;ResourceAttributeDesignator&lt;br /&gt;              AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;          &amp;lt;/ResourceMatch&gt;&lt;br /&gt;        &amp;lt;/Resource&gt;&lt;br /&gt;      &amp;lt;/Resources&gt;&lt;br /&gt;      &amp;lt;Actions&gt;&lt;br /&gt;        &amp;lt;Action&gt;&lt;br /&gt;          &amp;lt;ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;read&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;ActionAttributeDesignator&lt;br /&gt;              AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;          &amp;lt;/ActionMatch&gt;&lt;br /&gt;        &amp;lt;/Action&gt;&lt;br /&gt;      &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;/Target&gt;&lt;br /&gt;    &amp;lt;Condition&gt;&lt;br /&gt;      &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-subset"&gt;&lt;br /&gt;        &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin_customers&amp;lt;/AttributeValue&gt;&lt;br /&gt;        &amp;lt;/Apply&gt;&lt;br /&gt;        &amp;lt;SubjectAttributeDesignator AttributeId="group" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;      &amp;lt;/Apply&gt;&lt;br /&gt;    &amp;lt;/Condition&gt;&lt;br /&gt;  &amp;lt;/Rule&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Permit" RuleId="primary-group-emps-rule"&gt;&lt;br /&gt;    &amp;lt;Target&gt;&lt;br /&gt;      &amp;lt;Subjects&gt;&lt;br /&gt;        &amp;lt;AnySubject/&gt;&lt;br /&gt;      &amp;lt;/Subjects&gt;&lt;br /&gt;      &amp;lt;Resources&gt;&lt;br /&gt;        &amp;lt;Resource&gt;&lt;br /&gt;          &amp;lt;ResourceMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;http://localhost:8280/services/Customers/getEmployees&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;ResourceAttributeDesignator&lt;br /&gt;              AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;          &amp;lt;/ResourceMatch&gt;&lt;br /&gt;        &amp;lt;/Resource&gt;&lt;br /&gt;      &amp;lt;/Resources&gt;&lt;br /&gt;      &amp;lt;Actions&gt;&lt;br /&gt;        &amp;lt;Action&gt;&lt;br /&gt;          &amp;lt;ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"&gt;&lt;br /&gt;            &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;read&amp;lt;/AttributeValue&gt;&lt;br /&gt;            &amp;lt;ActionAttributeDesignator&lt;br /&gt;              AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;          &amp;lt;/ActionMatch&gt;&lt;br /&gt;        &amp;lt;/Action&gt;&lt;br /&gt;      &amp;lt;/Actions&gt;&lt;br /&gt;    &amp;lt;/Target&gt;&lt;br /&gt;    &amp;lt;Condition&gt;&lt;br /&gt;      &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-subset"&gt;&lt;br /&gt;        &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"&gt;&lt;br /&gt;          &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin_emps&amp;lt;/AttributeValue&gt;&lt;br /&gt;        &amp;lt;/Apply&gt;&lt;br /&gt;        &amp;lt;SubjectAttributeDesignator AttributeId="group" DataType="http://www.w3.org/2001/XMLSchema#string"/&gt;&lt;br /&gt;      &amp;lt;/Apply&gt;&lt;br /&gt;    &amp;lt;/Condition&gt;&lt;br /&gt;  &amp;lt;/Rule&gt;&lt;br /&gt;  &amp;lt;Rule Effect="Deny" RuleId="deny-rule"/&gt;&lt;br /&gt;&amp;lt;/Policy&gt;&lt;/pre&gt;Following are few valid requests which will result in "Permit/Not Applicable/Deny" once evaluated against the above policy.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;XACML request - 1&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;Resource : http://localhost:8280/services/Customers/getCustomers&lt;br /&gt;User : "admin" belongs only to "admin_customers" group&lt;br /&gt;Result : Permit&lt;pre name="code" class="html"&gt;&amp;lt;Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os"&lt;br /&gt; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;br /&gt; &amp;lt;Subject&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;admin&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="group"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;admin_customers&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Subject&gt;&lt;br /&gt; &amp;lt;Resource&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;http://localhost:8280/services/Customers/getCustomers&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Resource&gt;&lt;br /&gt; &amp;lt;Action&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;read&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Action&gt;&lt;br /&gt; &amp;lt;Environment /&gt;&lt;br /&gt;&amp;lt;/Request&gt; &lt;/pre&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;XACML request - 2&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;Resource : http://localhost:8280/services/Customers/getCustomers&lt;br /&gt;User : "admin" belongs only to "admin_emps" group&lt;br /&gt;Result : Deny&lt;pre name="code" class="html"&gt;&amp;lt;Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os"&lt;br /&gt; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;br /&gt; &amp;lt;Subject&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;admin&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="group"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;admin_emps&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Subject&gt;&lt;br /&gt; &amp;lt;Resource&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;http://localhost:8280/services/Customers/getCustomers&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Resource&gt;&lt;br /&gt; &amp;lt;Action&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;read&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Action&gt;&lt;br /&gt; &amp;lt;Environment /&gt;&lt;br /&gt;&amp;lt;/Request&gt; &lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-4384966288869131504?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/4384966288869131504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=4384966288869131504' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4384966288869131504'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/4384966288869131504'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/guide-to-write-xacml-policies-in-wso2_11.html' title='Guide to write XACML policies in WSO2 Identity Server - Part - 3'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-R/2766018423_ecf265c4de_m.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-4920427582902542838.post-5121853963995864501</id><published>2010-11-11T00:58:00.012+05:30</published><updated>2010-11-11T01:51:25.677+05:30</updated><category scheme='http://www.blogger.com/atom/ns#' term='XACML'/><title type='text'>Guide to write XACML policies in WSO2 Identity Server - Part - 2</title><content type='html'>This blog post is a follow up to the &lt;a href="http://blog.facilelogin.com/2009/06/guide-to-write-xacml-policies-in-wso2.html"&gt;Guide to write XACML policies in WSO2 Identity Server 2.0 - Part - I&lt;/a&gt; and also you may go through following as well..&lt;br /&gt;&lt;br /&gt;- &lt;a href="http://wso2.org/library/articles/2010/10/using-xacml-fine-grained-authorization-wso2-platform"&gt;Using XACML Fine Grained Authorization with the WSO2 Product Platform&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://blog.facilelogin.com/2009/05/identity-server-20-as-xacml-engine.html"&gt;Identity Server 2.0 as an XACML engine&lt;/a&gt;&lt;br /&gt;- &lt;a href="http://blog.facilelogin.com/2009/06/anatomy-of-xacml-request.html"&gt;Anatomy of the XACML Request&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Here I will present a XACML policy which addresses following requirement.&lt;br /&gt;&lt;br /&gt;"A given resource can be accessed only by any user belong to a particular role and all the requests to any other resource other than this should fail" &lt;pre name="code" class="html"&gt;&amp;lt;Policy PolicyId="urn:sample:xacml:2.0:samplepolicy"&lt;br /&gt; RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable"&lt;br /&gt; xmlns="urn:oasis:names:tc:xacml:2.0:policy:schema:os"&gt;&lt;br /&gt; &amp;lt;Description&gt;Sample XACML Authorization Policy&amp;lt;/Description&gt;&lt;br /&gt; &amp;lt;Target&gt;&lt;br /&gt;  &amp;lt;Subjects&gt;&lt;br /&gt;   &amp;lt;AnySubject /&gt;&lt;br /&gt;  &amp;lt;/Subjects&gt;&lt;br /&gt;  &amp;lt;Actions&gt;&lt;br /&gt;   &amp;lt;AnyAction /&gt;&lt;br /&gt;  &amp;lt;/Actions&gt;&lt;br /&gt;  &amp;lt;Resources&gt;&lt;br /&gt;   &amp;lt;AnyResource /&gt;&lt;br /&gt;  &amp;lt;/Resources&gt;&lt;br /&gt; &amp;lt;/Target&gt;&lt;br /&gt; &amp;lt;Rule Effect="Permit" RuleId="primary-group-rule"&gt;&lt;br /&gt;  &amp;lt;Target&gt;&lt;br /&gt;   &amp;lt;Subjects&gt;&lt;br /&gt;    &amp;lt;AnySubject /&gt;&lt;br /&gt;   &amp;lt;/Subjects&gt;&lt;br /&gt;   &amp;lt;Resources&gt;&lt;br /&gt;   &amp;lt;Resource&gt;&lt;br /&gt;    &amp;lt;ResourceMatch&lt;br /&gt;     MatchId="urn:oasis:names:tc:xacml:1.0:function:string-regexp-match"&gt;&lt;br /&gt;     &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;http://localhost:8280/services/echo/&lt;br /&gt;     &amp;lt;/AttributeValue&gt;&lt;br /&gt;     &amp;lt;ResourceAttributeDesignator&lt;br /&gt;      AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"&lt;br /&gt;      DataType="http://www.w3.org/2001/XMLSchema#string" /&gt;&lt;br /&gt;    &amp;lt;/ResourceMatch&gt;&lt;br /&gt;   &amp;lt;/Resource&gt;&lt;br /&gt;   &amp;lt;/Resources&gt;&lt;br /&gt;   &amp;lt;Actions&gt;&lt;br /&gt;    &amp;lt;Action&gt;&lt;br /&gt;     &amp;lt;ActionMatch MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"&gt;&lt;br /&gt;      &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;read&amp;lt;/AttributeValue&gt;&lt;br /&gt;      &amp;lt;ActionAttributeDesignator&lt;br /&gt;       AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"&lt;br /&gt;       DataType="http://www.w3.org/2001/XMLSchema#string" /&gt;&lt;br /&gt;     &amp;lt;/ActionMatch&gt;&lt;br /&gt;    &amp;lt;/Action&gt;&lt;br /&gt;   &amp;lt;/Actions&gt;&lt;br /&gt;  &amp;lt;/Target&gt;&lt;br /&gt;  &amp;lt;Condition&gt;&lt;br /&gt;   &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-subset"&gt;&lt;br /&gt;    &amp;lt;Apply FunctionId="urn:oasis:names:tc:xacml:1.0:function:string-bag"&gt;&lt;br /&gt;     &amp;lt;AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"&gt;admin&amp;lt;/AttributeValue&gt;&lt;br /&gt;    &amp;lt;/Apply&gt;&lt;br /&gt;    &amp;lt;SubjectAttributeDesignator AttributeId="group"&lt;br /&gt;     DataType="http://www.w3.org/2001/XMLSchema#string" /&gt;&lt;br /&gt;   &amp;lt;/Apply&gt;&lt;br /&gt;  &amp;lt;/Condition&gt;&lt;br /&gt; &amp;lt;/Rule&gt;&lt;br /&gt; &amp;lt;Rule Effect="Deny" RuleId="deny-rule" /&gt;&lt;br /&gt;&amp;lt;/Policy&gt;&lt;br /&gt;&lt;/pre&gt;Following are few valid requests which will result in "Permit/Not Applicable/Deny" once evaluated against the above policy.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;XACML request - 1&lt;/u&gt;&lt;/b&gt; &lt;br /&gt;Resource : http://localhost:8280/services/echo/&lt;br /&gt;User : "admin" belongs only to "admin" group&lt;br /&gt;Result : Permit&lt;pre name="code" class="html"&gt;&amp;lt;Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os"&lt;br /&gt; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;br /&gt; &amp;lt;Subject&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;admin&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="group"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;admin&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Subject&gt;&lt;br /&gt; &amp;lt;Resource&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;http://localhost:8280/services/echo/&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Resource&gt;&lt;br /&gt; &amp;lt;Action&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;read&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Action&gt;&lt;br /&gt; &amp;lt;Environment /&gt;&lt;br /&gt;&amp;lt;/Request&gt; &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;XACML request - 2&lt;/u&gt;&lt;/b&gt; &lt;br /&gt;Resource : http://localhost:8280/services/echo/&lt;br /&gt;User : "admin" belongs to "admin" group and "business" group&lt;br /&gt;Result : Permit&lt;pre name="code" class="html"&gt;&amp;lt;Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os"&lt;br /&gt; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;br /&gt; &amp;lt;Subject&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;admin&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="group"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;admin&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="group"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;business&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Subject&gt;&lt;br /&gt; &amp;lt;Resource&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;http://localhost:8280/services/echo/&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Resource&gt;&lt;br /&gt; &amp;lt;Action&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;read&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Action&gt;&lt;br /&gt; &amp;lt;Environment /&gt;&lt;br /&gt;&amp;lt;/Request&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;XACML request - 3&lt;/u&gt;&lt;/b&gt; &lt;br /&gt;Resource : http://localhost:8280/services/test/&lt;br /&gt;User : "admin" belongs to "admin" group&lt;br /&gt;Result : Deny&lt;pre name="code" class="html"&gt;&amp;lt;Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os"&lt;br /&gt; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;br /&gt; &amp;lt;Subject&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;admin&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="group"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;admin&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Subject&gt;&lt;br /&gt; &amp;lt;Resource&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;http://localhost:8280/services/test/&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Resource&gt;&lt;br /&gt; &amp;lt;Action&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;read&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Action&gt;&lt;br /&gt; &amp;lt;Environment /&gt;&lt;br /&gt;&amp;lt;/Request&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;XACML request - 4&lt;/u&gt;&lt;/b&gt; &lt;br /&gt;Resource : http://localhost:8280/services/echo/&lt;br /&gt;User : "admin" belongs to "business" group&lt;br /&gt;Result : Deny&lt;pre name="code" class="html"&gt;&amp;lt;Request xmlns="urn:oasis:names:tc:xacml:2.0:context:schema:os"&lt;br /&gt; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;&lt;br /&gt; &amp;lt;Subject&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:subject:subject-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;admin&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="group"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;business&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Subject&gt;&lt;br /&gt; &amp;lt;Resource&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;http://localhost:8280/services/echo/&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Resource&gt;&lt;br /&gt; &amp;lt;Action&gt;&lt;br /&gt;  &amp;lt;Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id"&lt;br /&gt;   DataType="http://www.w3.org/2001/XMLSchema#string"&gt;&lt;br /&gt;   &amp;lt;AttributeValue&gt;read&amp;lt;/AttributeValue&gt;&lt;br /&gt;  &amp;lt;/Attribute&gt;&lt;br /&gt; &amp;lt;/Action&gt;&lt;br /&gt; &amp;lt;Environment /&gt;&lt;br /&gt;&amp;lt;/Request&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/4920427582902542838-5121853963995864501?l=blog.facilelogin.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.facilelogin.com/feeds/5121853963995864501/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=4920427582902542838&amp;postID=5121853963995864501' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5121853963995864501'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4920427582902542838/posts/default/5121853963995864501'/><link rel='alternate' type='text/html' href='http://blog.facilelogin.com/2010/11/guide-to-write-xacml-policies-in-wso2.html' title='Guide to write XACML policies in WSO2 Identity Server - Part - 2'/><author><name>Prabath</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='25' height='32' src='http://1.bp.blogspot.com/_K2WLYAmEH8g/SKYaYnca9eI/AAAAAAAAAdY/eax9foDOWx4/s1600-
