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

<channel>
	<title>Just for today...</title>
	<atom:link href="http://blog.dzhuvinov.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://blog.dzhuvinov.com</link>
	<description>A blog by Vladimir Dzhuvinov</description>
	<lastBuildDate>Thu, 09 Sep 2010 13:31:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Ajax style LDAP access</title>
		<link>http://blog.dzhuvinov.com/?p=512</link>
		<comments>http://blog.dzhuvinov.com/?p=512#comments</comments>
		<pubDate>Thu, 09 Sep 2010 13:31:50 +0000</pubDate>
		<dc:creator>Vladimir Dzhuvinov</dc:creator>
				<category><![CDATA[JSON]]></category>
		<category><![CDATA[JSON-RPC]]></category>
		<category><![CDATA[Json2Ldap]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.dzhuvinov.com/?p=512</guid>
		<description><![CDATA[Ajax-style directory access is easy with Json2Ldap. What you need: A Json2Ldap installation to take in directory requests in the form of JSON messages and translate them to the binary LDAP protocol (and then back). An LDAP v3 compatible directory server, such as OpenLDAP, Microsoft Active Directory, IBM Tivoli Directory Server or Novell eDirectory. A [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.dzhuvinov.com/wp-content/uploads/2010/06/icon-json2ldap-128x128.png" alt="Json2Ldap icon" title="icon-json2ldap-128x128" width="128" height="128" class="alignright size-full wp-image-291" />Ajax-style directory access is easy with <a href="http://localhost/~vd/SoftwareShop/json2ldap.html">Json2Ldap</a>.</p>
<p>What you need:</p>
<ol>
<li>A <a href="http://localhost/~vd/SoftwareShop/json2ldap.html">Json2Ldap</a> installation to take in directory requests in the form of <a href="http://www.json.org">JSON</a> messages and translate them to the binary <a href="http://en.wikipedia.org/wiki/LDAP">LDAP</a> protocol (and then back).</li>
<li>An LDAP v3 compatible directory server, such as <a href="http://www.openldap.org/">OpenLDAP</a>, <a href="http://en.wikipedia.org/wiki/Active_Directory">Microsoft Active Directory</a>, <a href="http://en.wikipedia.org/wiki/IBM_Tivoli_Directory_Server">IBM Tivoli Directory Server</a> or <a href="http://en.wikipedia.org/wiki/Novell_eDirectory">Novell eDirectory</a>.</li>
<li>A JavaScript library to streamline the dispatch of <a href="http://en.wikipedia.org/wiki/XMLHttpRequest">XMLHttpRequests</a>, my favourite is <a href="http://jquery.com/">jQuery</a>. Also a <a href="http://www.json.org/json2.js">JSON encoder/decoder</a>.</li>
</ol>
<p>To utilise a remote directory you must connect to it first. Instead of devising its own message schema, Json2Ldap speaks standard <a href="http://groups.google.com/group/json-rpc/web/json-rpc-2-0">JSON-RPC 2.0</a>. Here is how the <a href="http://localhost/~vd/SoftwareShop/json2ldap-api.html#ldap.connect">connect</a> request is composed in JavaScript:</p>
<pre>
var request = {};
request.method = "ldap.connect";
request.params = {};
request.params.host = "ldap.host.net";
request.params.port = 389;
request.id = 0;
request.jsonrpc = "2.0";
</pre>
<p>The <em>host</em> and <em>port</em> parameters specify the network location of the LDAP server. Serialised to JSON the request may look like that:</p>
<pre>
{
 "method" : "ldap.connect",
 "params" : { "host" : "ldap.host.net", "port" : 389 },
 "id" : 0,
 "jsonrpc" : "2.0"
}
</pre>
<p>We then send off the request using <a href="http://api.jquery.com/jQuery.post/">jQuery's HTTP POST wrapper</a>. If all goes well the callback function will receive a result that contains an LDAP connection identifier, which we must save for later requests.</p>
<pre>
// The Json2Ldap URL
var url = "http://tomcat.host.net:8080/json2ldap/";

// The LDAP connection CID
var cid = null;

// The callback function
function saveCID(response) {
	if (response.result)
		cid = response.result;
	else if (response.error)
		alert("Connect error: " + response.error.message);
};

$.post(url, JSON.stringify(request), saveCID, "json");
</pre>
<p>Json2Ldap's <a href="http://localhost/~vd/SoftwareShop/json2ldap-api.html">web API</a> covers the entire set of standard LDAP commands as well as a few extended controls and operations. <a href="http://localhost/~vd/SoftwareShop/json2ldap-api.html#ldap.search">Search</a> is however perhaps the most commonly used directory command.</p>
<pre>
function displaySearchResult(response) {
	if (response.result)
		alert("Found " + response.result.matches.length + "match(es)");
	else if (response.error)
		alert("Search error: " + response.error.message);
};

var request = {};
request.method = "ldap.search";
request.params = {};
request.params.CID = cid;
request.params.baseDN = "ou=people,dc=example,dc=com";
request.params.scope = "ONE";
request.params.filter = "(givenName=Agnese)";
request.id = 1;
request.jsonrpc = "2.0";

$.post(url, JSON.stringify(request), displaySearchResult, "json");
</pre>
<p>Here is an example search result entry, formatted as <a href="http://en.wikipedia.org/wiki/LDAP_Data_Interchange_Format">LDIF</a> (users have got choice - Json2Ldap allows for JSON as well as LDIF result formatting).</p>
<div id="attachment_521" class="wp-caption aligncenter" style="width: 408px"><img src="http://blog.dzhuvinov.com/wp-content/uploads/2010/09/sample-search-result-entry-ldif.jpg" alt="" title="sample-search-result-entry-ldif" width="398" height="327" class="size-full wp-image-521" /><p class="wp-caption-text">Sample search result entry in LDIF format</p></div>
<p>In one of my next posts I'll give you some cool <a href="http://en.wikipedia.org/wiki/Mashup_(web_application_hybrid)">mashup</a> examples utilising the Json2Ldap web service <img src='http://blog.dzhuvinov.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dzhuvinov.com/?feed=rss2&amp;p=512</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Json2Ldap with improved directory search</title>
		<link>http://blog.dzhuvinov.com/?p=471</link>
		<comments>http://blog.dzhuvinov.com/?p=471#comments</comments>
		<pubDate>Tue, 31 Aug 2010 19:23:00 +0000</pubDate>
		<dc:creator>Vladimir Dzhuvinov</dc:creator>
				<category><![CDATA[JSON]]></category>
		<category><![CDATA[JSON-RPC]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.dzhuvinov.com/?p=471</guid>
		<description><![CDATA[Json2Ldap 1.5 is out. The most recent release of the web gateway for connecting to LDAP v4 compatible directories via JSON-RPC delivers several incremental improvements, the most notable being the expanded capabilities of the ldap.search command. It now gives programmers finer control over the entry attributes which the method returns. The available choices: Return all [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.dzhuvinov.com/wp-content/uploads/2010/06/icon-json2ldap-128x128.png" alt="Json2Ldap icon" title="icon-json2ldap-128x128" width="128" height="128" class="alignleft size-full wp-image-291" /><a href="http://software.dzhuvinov.com/json2ldap.html">Json2Ldap</a> 1.5 is out.</p>
<p>The most recent release of the web gateway for connecting to LDAP v4 compatible directories via JSON-RPC delivers several incremental improvements, the most notable being the expanded capabilities of the <a href="http://software.dzhuvinov.com/json2ldap-api.html#ldap.search"><code>ldap.search</code></a> command. It now gives programmers finer control over the entry attributes which the method returns.</p>
<p>The available choices:</p>
<ul>
<li>Return all user attributes.</li>
<li>Return all operational attributes (attributes associated with a directory object for administrative purposes).</li>
<li>Return only the specified attributes.</li>
<li>Don't return any attributes.</li>
</ul>
<p>Let's illustrate these choices with a few example JSON-RPC 2.0 requests/responses.</p>
<p>First, connect to the default remote directory with <code><a href="http://software.dzhuvinov.com/json2ldap-api.html#ldap.connect">ldap.connect</a></code>.</p>
<p>The connect request:</p>
<pre>
{ "method"  : "ldap.connect",
  "id"      : 1,
  "jsonrpc" : "2.0" }
</pre>
<p>The connect response, returning a string token to identify the LDAP connection (CID = connection identifier) in later requests:</p>
<pre>
{ "result"  : "-31ccd4bdbe6170b69956fe1c2eeffb42",
  "id"      : 1,
  "jsonrpc" : "2.0" }
</pre>
<p><strong>Example 1: Return all user attributes.</strong></p>
<p>This is the default action. To do that simply omit the <code>attributes</code> parameter (or set it to "*").</p>
<p>The request:</p>
<pre>
{ "method" : "ldap.search",
  "params" : { "CID"    : "-31ccd4bdbe6170b69956fe1c2eeffb42",
               "scope"  : "ONE",
               "baseDN" : "ou=people,dc=example,dc=com",
	       "filter" : "(uid=user.0)" },
  "id":1,
  "jsonrpc" : "2.0" }
</pre>
<p>The response:</p>
<pre>
{ "result"  : { "matches" : [ { "DN"          : "uid=user.0,ou=People,dc=example,dc=com",
                                "objectClass" : [ "person",
						  "inetorgperson",
						  "organizationalperson",
						  "top"],
			        "uid"         : ["user.0" ],
				"cn"          : ["Aaccf Amar"],
				"sn"          : ["Amar"],
				"givenName"   : ["Aaccf"],
				"initials"    : ["ASA"],
				"mail"        : ["user.0@maildomain.net"],
				"street"      : ["0125 Chestnut Street"],
				"l"           : ["Panama City"],
				"mobile"      : ["+1 010 154 3228"] } ],
                "referrals" : [] },
  "id"      : 1,
  "jsonrpc" : "2.0" }
</pre>
<p><strong>Example 2: Return all operational attributes</strong></p>
<p>Set the <code>attributes</code> parameter to "+":</p>
<p>The request:</p>
<pre>
{ "method" : "ldap.search",
  "params" : { "CID"        : "-31ccd4bdbe6170b69956fe1c2eeffb42",
               "scope"      : "ONE",
               "baseDN"     : "ou=people,dc=example,dc=com",
	       "filter"     : "(uid=user.0)",
	       "<strong>attributes</strong>" : "<strong>+</strong>" },
  "id":1,
  "jsonrpc" : "2.0" }
</pre>
<p>The response:</p>
<pre>
{ "result"  : { "matches" : [ { "DN"                : "uid=user.0,ou=People,dc=example,dc=com",
                                "subschemaSubentry" : ["cn=schema"],
			        "entryUUID"	    : ["ad55a34a-763f-358f-93f9-da86f9ecd9e4"],
			        "entryDN"	    : ["uid=user.0,ou=people,dc=example,dc=com"],
			        "modifiersName"     : ["cn=Directory Manager,cn=Root DNs,cn=config"],
			        "modifyTimestamp"   : ["20100622033521Z"] } ],
                "referrals" : [] },
  "id"      : 1,
  "jsonrpc" : "2.0" }</pre>
<p><strong>Example 3: Return only the specified attributes</strong></p>
<p>Set the <code>attributes</code> parameter to a string listing the required attribute names.</p>
<p>The request:</p>
<pre>
{ "method" : "ldap.search",
  "params" : { "CID"        : "-31ccd4bdbe6170b69956fe1c2eeffb42",
               "scope"      : "ONE",
               "baseDN"     : "ou=people,dc=example,dc=com",
	       "filter"     : "(uid=user.0)",
	       "<strong>attributes</strong>" : "<strong>cn mail</strong>" },
  "id":1,
  "jsonrpc" : "2.0" }
</pre>
<p>The response:</p>
<pre>
{ "result"  : { "matches" : [ { "DN"   : "uid=user.0,ou=People,dc=example,dc=com",
                                "cn"   : ["Aaccf Amar"],
				"mail" : ["user.0@maildomain.net"] } ],
                "referrals" : [] },
  "id"      : 1,
  "jsonrpc" : "2.0" }
</pre>
<p><strong>Example 4: Don't return any attributes</strong></p>
<p>Set the <code>attributes</code> parameter to an empty string.</p>
<p>The request:</p>
<pre>
{ "method" : "ldap.search",
  "params" : { "CID"        : "-31ccd4bdbe6170b69956fe1c2eeffb42",
               "scope"      : "ONE",
               "baseDN"     : "ou=people,dc=example,dc=com",
	       "filter"     : "(uid=user.0)",
	       "<strong>attributes</strong>" : "" },
  "id":1,
  "jsonrpc" : "2.0" }
</pre>
<p>The response:</p>
<pre>
{ "result"  : { "matches"   : [ { "DN" : "uid=user.0,ou=People,dc=example,dc=com" } ],
                "referrals" : [] },
  "id"      : 1,
  "jsonrpc" : "2.0" }
</pre>
<p>So, what's next on the Json2Ldap roadmap? HTTP <a href="http://www.w3.org/TR/cors/">Cross-Origin Resource Sharing</a> (CORS) support!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dzhuvinov.com/?feed=rss2&amp;p=471</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Retrieving enum parameters from JSON-RPC 2.0 requests</title>
		<link>http://blog.dzhuvinov.com/?p=460</link>
		<comments>http://blog.dzhuvinov.com/?p=460#comments</comments>
		<pubDate>Tue, 31 Aug 2010 12:19:55 +0000</pubDate>
		<dc:creator>Vladimir Dzhuvinov</dc:creator>
				<category><![CDATA[JSON]]></category>
		<category><![CDATA[JSON-RPC]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.dzhuvinov.com/?p=460</guid>
		<description><![CDATA[Since version 1.9.2 of the JsonRpc2-Base library its utility classes add support for convenient retrieval of enumerated request parameters. Such occur in situations when an RPC parameter has a fixed set of possible values. A typical example is a person's sex, which can be either "male" or "female". So, if you've got an enum class [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.dzhuvinov.com/wp-content/uploads/2010/06/icon-jsonrpc-128x128.png"><img src="http://blog.dzhuvinov.com/wp-content/uploads/2010/06/icon-jsonrpc-128x128.png" alt="JSON-RPC 2.0" title="icon-jsonrpc-128x128" width="128" height="128" class="alignleft size-full wp-image-258" /></a>Since version 1.9.2 of the <a href="http://software.dzhuvinov.com/json-rpc-2.0-base-java-classes.html">JsonRpc2-Base library</a> its <a href="http://software.dzhuvinov.com/files/jsonrpc_base/api/com/thetransactioncompany/jsonrpc2/util/package-summary.html">utility classes</a> add support for convenient retrieval of enumerated request parameters. Such occur in situations when an RPC parameter has a fixed set of possible values. A typical example is a person's sex, which can be either "male" or "female".</p>
<p>So, if you've got an <a href="http://download.oracle.com/javase/tutorial/java/javaOO/enum.html">enum class</a> defined, you can directly retrieve the parameter as the matching enum constant.</p>
<p>The enum class definition:</p>
<pre>
public enum Sex {
        MALE,
        FEMALE
}
</pre>
<p>Retrieving the enum parameter from a JSON-RPC 2.0 request (assuming named parameters):</p>
<pre>
JSONRPC2Request req = JSONRPC2Request.parse("... the request string ...");

// Create a new retriever for named parameters
Map params = (Map)req.getParams();
NamedParamsRetriever ret = new NamedParamsRetriever(params);

// Get the enum param as constant
Sex sex = ret.getEnum("sex", Sex.class);

if (sex == Sex.MALE)
       System.out.println("Got male");
else
       System.out.println("Got female");
</pre>
<p>The first argument of the <code><a href="http://software.dzhuvinov.com/files/jsonrpc_base/api/com/thetransactioncompany/jsonrpc2/util/NamedParamsRetriever.html#getEnum(java.lang.String,%20java.lang.Class)">getEnum</a></code> method specifies the parameter name, the second the defining enum class.</p>
<p><strong>Clever bit:</strong> If the parameter value is not matched by a constant in the enum class the method will automatically throw a standard "Invalid parameters" <a href="http://software.dzhuvinov.com/files/jsonrpc_base/api/com/thetransactioncompany/jsonrpc2/JSONRPC2Error.html">JSONRPC2Error</a> with code -32602.</p>
<p>There are also variations of the <code><a href="http://software.dzhuvinov.com/files/jsonrpc_base/api/com/thetransactioncompany/jsonrpc2/util/NamedParamsRetriever.html#getEnum(java.lang.String,%20java.lang.Class)">getEnum</a></code> method that allow for case insensitive matching or for optional parameters that will be given a default value if they are omitted from the request.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dzhuvinov.com/?feed=rss2&amp;p=460</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>24 часовият маратон издание 2010 наближава!</title>
		<link>http://blog.dzhuvinov.com/?p=457</link>
		<comments>http://blog.dzhuvinov.com/?p=457#comments</comments>
		<pubDate>Tue, 31 Aug 2010 11:23:18 +0000</pubDate>
		<dc:creator>Vladimir Dzhuvinov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.dzhuvinov.com/?p=457</guid>
		<description><![CDATA[На 11+12 септември Крива спица събира байк терминатори от всички краища на България на 24 часов планински маратон по жестоки пътечки около х. Здравец. Елате, преживяването ще бъде яко и за всички - както за състезатели, така и за зрители!!! Маратонът, тази година в четвъртото си издание, вече се превръща в традиция. Какво да очакваме [...]]]></description>
			<content:encoded><![CDATA[<p>На 11+12 септември <a href="http://kriva.org">Крива спица</a> събира байк терминатори от всички краища на България на 24 часов планински маратон по жестоки пътечки около х. Здравец. Елате, преживяването ще бъде яко и за всички - както за състезатели, така и за зрители!!!</p>
<p><img alt="" src="http://mtb24.kriva.org/images/stories/24hMTB_poster_2010.jpg" title="Плакатът на 24h издание 2010" class="aligncenter" width="571" height="799" /></p>
<p>Маратонът, тази година в четвъртото си издание, вече се превръща в традиция. Какво да очакваме този път? Ново трасе, по-големи награди, а може би и нови лица и нови спортни постижения <img src='http://blog.dzhuvinov.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  <a href="http://kriva.org">Крива спица</a> осигурява перфектната организация, а вие - състезатели и зрители - хубавата емоция <img src='http://blog.dzhuvinov.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>За подробности - регистрация, трасе, правила - вижте <a href="http://mtb24.kriva.org/">специалния 24h сайт</a> на Крива спица.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dzhuvinov.com/?feed=rss2&amp;p=457</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Seatpost wisdom</title>
		<link>http://blog.dzhuvinov.com/?p=444</link>
		<comments>http://blog.dzhuvinov.com/?p=444#comments</comments>
		<pubDate>Tue, 24 Aug 2010 12:37:50 +0000</pubDate>
		<dc:creator>Vladimir Dzhuvinov</dc:creator>
				<category><![CDATA[mtb]]></category>

		<guid isPermaLink="false">http://blog.dzhuvinov.com/?p=444</guid>
		<description><![CDATA[Always choose the longer postpost ... particularly if you're getting a new bike frame. But why would you need a new one? Because bike manufacturers have gone overboard with sizes and today when you buy a new frame it's very likely it would have its own seatpost diameter. A quick wikipedia check shows how many [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>Always choose the longer postpost</p></blockquote>
<p>... particularly if you're getting a new bike frame.</p>
<p>But why would you need a new one?</p>
<p>Because bike manufacturers have gone overboard with sizes and today when you buy a new frame it's very likely it would have its own seatpost diameter. A quick <a href="http://en.wikipedia.org/wiki/Seatpost">wikipedia</a> check shows how many <strong>"standard"</strong> diameters are in existence today. Hold your breath:</p>
<p><em>22.0, 22.2, 23.4, 23.8, 24.0, 25.0, 25.4, 25.8, 26.0, 26.2, 26.4, 26.6, 26.8, 27.0, 27.2, 27.4, 27.8, 28.0, 28.6, 29.4, 29.6, 29.8, 30.0, 30.4, 30.8, 30.9, 31.4, 31.6, 31.8, 32</em></p>
<p>Something like 30 if you bother to count them.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dzhuvinov.com/?feed=rss2&amp;p=444</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>First look at JsonSSO</title>
		<link>http://blog.dzhuvinov.com/?p=399</link>
		<comments>http://blog.dzhuvinov.com/?p=399#comments</comments>
		<pubDate>Tue, 17 Aug 2010 11:01:11 +0000</pubDate>
		<dc:creator>Vladimir Dzhuvinov</dc:creator>
				<category><![CDATA[JSON]]></category>
		<category><![CDATA[JSON-RPC]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[JsonSSO]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.dzhuvinov.com/?p=399</guid>
		<description><![CDATA[Earlier in August I began work on JsonSSO, a web service that provides single sign-on and session management. It naturally complements Json2Ldap, another product of mine which provides web-friendly JSON-RPC access to LDAP v3 compatible directories such as OpenLDAP, MS AD and Novell eDirectory. The recent years we saw a proliferation of single sign-on (SSO) [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.dzhuvinov.com/wp-content/uploads/2010/08/icon-jsonsso-128x128.png"><img src="http://blog.dzhuvinov.com/wp-content/uploads/2010/08/icon-jsonsso-128x128.png" alt="" title="icon-jsonsso-128x128" width="128" height="128" class="alignleft size-full wp-image-429" /></a>Earlier in August I began work on <strong>JsonSSO</strong>, a web service that provides single sign-on and session management. It naturally complements <a href="http://software.dzhuvinov.com/json2ldap.html">Json2Ldap</a>, another product of mine which provides web-friendly JSON-RPC access to LDAP v3 compatible directories such as OpenLDAP, MS AD and Novell eDirectory.</p>
<p>The recent years we saw a proliferation of single sign-on (SSO) solutions. While the underlying concept of SSO is relatively simple, the IT context (participating apps, authentication methods, back-ends, platforms, policy, etc.) can vary significantly, which has prompted the development of so many implementations.</p>
<p>JsonSSO has three defining features:</p>
<ol>
<li>User authentication is done against a back-end LDAP directory via Json2Ldap.</li>
<li>Once a user session is established, participating web clients may be given an open LDAP connection (by means of Json2Ldap) bound as the currently logged-in user. This connection allows web clients convenient and flexible access to user details such as user ID, name, email, photo, application preferences, etc.</li>
<li>An internal database records the details of all active and expired user sessions. It can be queried for audit and management purposes via a JSON-RPC interface.</li>
</ol>
<p>For JsonSSO to be easy to understand and work with I intend to stick to these three main features. Diversions, such as adding DB-based authentication, will be avoided. I want to have JsonSSO as web-friendly as possible, keeping all incoming (from clients) and outgoing (to back-end) connections in the form of HTTP.</p>
<p>Here is a preliminary overview of the JsonSSO API and its configuration settings. These may change somewhat by the time JsonSSO is officially released (Q4 2010).</p>
<p><strong>JSON-RPC 2.0 API</strong></p>
<ul>
<li><strong>sso.login</strong> Initial login with an authenticating ID (username, email, etc.) and password. Returns a new session identifier (SID) which can be passed between the participating web clients and apps.</li>
<li><strong>sso.logout</strong> Closes a user session. Can be invoked by any of the participating web clients and apps that holding the corresponding SID.</li>
</ul>
<ul>
<li><strong>sso.getUserID</strong> By passing a valid SID, clients can get the user's system/org-wide ID.</li>
<li><strong>sso.getUserDN</strong> By passing a valid SID, clients can get the distinct name (DN) of the user, i.e. their directory record.</li>
</ul>
<ul>
<li><strong>sso.getJson2LdapURL</strong> Returns the URL of the Json2Ldap web service.</li>
<li><strong>sso.getAnonymousLdapConnection</strong> Returns an anonymous LDAP connection (via Json2Ldap) to the back-end directory (if permitted by config).</li>
<li><strong>sso.getBoundLdapConnection</strong> Returns an LDAP connection (via Json2Ldap) bound as the currently logged-in user (if permitted by config and the web client/app has authorisation).</li>
</ul>
<ul>
<li><strong>sso.refresh</strong> Allows clients/apps to extend a user session by presenting its SID, otherwise it would eventually expire after a preconfigured idle time.</li>
<li><strong>sso.getSessionSettings</strong> Returns the max idle time, max duration and other settings for a session represented by a given SID.</li>
</ul>
<ul>
<li><strong>sso.registerLogoutCallback</strong> Allows participating web apps to receive a notification that the user has logged out and the session has ended.</li>
<li><strong>sso.unregisterLogoutCallback</strong> Allows to cancel a previously registered logout notification.</li>
<li><strong>sso.listRegisteredCallbacks</strong> Lists all web apps that have requested to receive a logout notification.</li>
</ul>
<ul>
<li><strong>sso.listSessions</strong> Lists the details of current or expired sessions. Regular users can only access their own session history. Administrators have full access.</li>
</ul>
<ul>
<li><strong>ws.getName</strong> Returns the web service name.</li>
<li><strong>ws.getVersion</strong> Returns the web service version.</li>
<li><strong>ws.getTime</strong> Returns the local web service time.</li>
</ul>
<p><strong>JsonSSO configuration parameters</strong></p>
<p>This set of parameters governs web client/app access to the JsonSSO service:</p>
<ul>
<li>jsonsso.clients.requireHttps</li>
<li>jsonsso.clients.returnAnonymousLdapConnection</li>
<li>jsonsso.clients.returnBoundLdapConnection</li>
<li>jsonsso.clients.allowLogoutCallbacks</li>
</ul>
<p>User session limits:</p>
<ul>
<li>jsonsso.sessions.maxTime</li>
<li>jsonsso.sessions.maxIdleTime</li>
<li>jsonsso.sessions.quotaPerUser</li>
<li>jsonsso.sessions.onQuotaExhaustion</li>
</ul>
<p>Specifies the Json2Ldap URL through which the back-end LDAP directory will be accessed:</p>
<ul>
<li>jsonsso.json2ldap.url</li>
<li>jsonsso.json2ldap.trustSelfSignedCerts</li>
</ul>
<p>Specifies the server details of the back-end LDAP directory. If the <code>useDefault</code> parameter is <code>true</code> JsonSSO will use the default LDAP server for the configured Json2Ldap gateway/proxy.</p>
<ul>
<li>jsonsso.ldapServer.useDefault</li>
<li>jsonsso.ldapServer.host</li>
<li>jsonsso.ldapServer.port</li>
<li>jsonsso.ldapServer.timeout</li>
<li>jsonsso.ldapServer.security</li>
<li>jsonsso.ldapServer.trustSelfSignedCerts</li>
</ul>
<p>The <code>uidAttribute</code> parameter specifies the name of the LDAP attribute that holds the system/org-wide user IDs (typically userid but may be something else). If set, the <code>groupDn</code> parameter governs which users are allowed to login via JsonSSO.</p>
<ul>
<li>jsonsso.users.uidAttribute</li>
<li>jsonsso.users.groupDn</li>
</ul>
<p>This set of parameters determines how to derive the user directory record (DN) from the username or email entered at login:</p>
<ul>
<li>jsonsso.dnResolution.method</li>
<li>jsonsso.dnResolution.dnTemplate</li>
<li>jsonsso.dnResolution.searchFilter</li>
<li>jsonsso.dnResolution.searchBaseDn</li>
<li>jsonsso.dnResolution.searchUserDn</li>
<li>jsonsso.dnResolution.searchUserPassword</li>
</ul>
<p>This set of parameters determine which users have admin access to the session logs:</p>
<ul>
<li>jsonsso.admin.dn</li>
<li>jsonsso.admin.groupDn</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.dzhuvinov.com/?feed=rss2&amp;p=399</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Със Салса Буда на Водната планина</title>
		<link>http://blog.dzhuvinov.com/?p=390</link>
		<comments>http://blog.dzhuvinov.com/?p=390#comments</comments>
		<pubDate>Mon, 16 Aug 2010 15:12:45 +0000</pubDate>
		<dc:creator>Vladimir Dzhuvinov</dc:creator>
				<category><![CDATA[Рила]]></category>

		<guid isPermaLink="false">http://blog.dzhuvinov.com/?p=390</guid>
		<description><![CDATA[С Илиан от пловдивската Salsa de Cuba си направихме епичен поход из "Водната планина" или както траките са наричали Рила. Маршрутът ни мина през стръмните зъбери на Мальовица, после по билото до хижа Иван Вазов, след което се спуснахме и до Седемте рилски езера. Там където водата и планината докосват толкова високо небето, там спокойствието [...]]]></description>
			<content:encoded><![CDATA[<p>С Илиан от пловдивската <a href="http://www.salsadecuba.org/">Salsa de Cuba</a> си направихме епичен поход из "Водната планина" или както траките са наричали Рила. Маршрутът ни мина през стръмните зъбери на Мальовица, после по билото до хижа Иван Вазов, след което се спуснахме и до Седемте рилски езера.</p>
<p>Там където водата и планината докосват толкова високо небето, там спокойствието и усещането за чистота са наистина невероятни!</p>
<div id="attachment_391" class="wp-caption aligncenter" style="width: 610px"><a href="http://blog.dzhuvinov.com/wp-content/uploads/2010/08/Hike-Rila-12600.2.jpg"><img src="http://blog.dzhuvinov.com/wp-content/uploads/2010/08/Hike-Rila-12600.2.jpg" alt="Салса Буда на Елениното езеро" title="Hike-Rila-12600.2" width="600" height="400" class="size-full wp-image-391" /></a><p class="wp-caption-text">Салса Буда на Елениното езеро</p></div>
<p><a href="http://photoblog.dzhuvinov.com/index.php?showimage=278"><img alt="" src="http://photoblog.dzhuvinov.com/thumbnails/thumb_20100816143532_hike-rila-12703.1.jpg" title="Рила" class="alignleft" width="100" height="75" /></a><a href="http://photoblog.dzhuvinov.com/index.php?showimage=277"><img alt="" src="http://photoblog.dzhuvinov.com/thumbnails/thumb_20100816143500_hike-rila-12680.1.jpg" title="Рила" class="alignleft" width="100" height="75" /></a><a href="http://photoblog.dzhuvinov.com/index.php?showimage=276"><img alt="" src="http://photoblog.dzhuvinov.com/thumbnails/thumb_20100816143442_hike-rila-12666.1.jpg" title="Рила" class="alignleft" width="100" height="75" /></a><a href="http://photoblog.dzhuvinov.com/index.php?showimage=274"><img alt="" src="http://photoblog.dzhuvinov.com/thumbnails/thumb_20100816143345_hike-rila-12637.1.jpg" title="Рила" class="alignleft" width="100" height="75" /></a><a href="http://photoblog.dzhuvinov.com/index.php?showimage=275"><img alt="" src="http://photoblog.dzhuvinov.com/thumbnails/thumb_20100816143418_hike-rila-12649.1.jpg" title="Рила" class="alignleft" width="100" height="75" /></a></p>
<p style="clear: both">
]]></content:encoded>
			<wfw:commentRss>http://blog.dzhuvinov.com/?feed=rss2&amp;p=390</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LDAP web service software updated</title>
		<link>http://blog.dzhuvinov.com/?p=373</link>
		<comments>http://blog.dzhuvinov.com/?p=373#comments</comments>
		<pubDate>Mon, 16 Aug 2010 14:08:37 +0000</pubDate>
		<dc:creator>Vladimir Dzhuvinov</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.dzhuvinov.com/?p=373</guid>
		<description><![CDATA[Json2Ldap 1.4, released yesterday, simplifies its JSON-RPC 2.0 API to become an even friendlier web service for working with LDAP compatible back-end directories. The calls to make plain, secure and default LDAP connections are now merged into a single RPC method named ldap.connect. To make a connection to the default LDAP server (specified in the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.dzhuvinov.com/wp-content/uploads/2010/06/icon-json2ldap-128x128.png"><img src="http://blog.dzhuvinov.com/wp-content/uploads/2010/06/icon-json2ldap-128x128.png" alt="Json2Ldap icon" title="icon-json2ldap-128x128" width="128" height="128" class="alignleft size-full wp-image-291" /></a><a href="http://software.dzhuvinov.com/json2ldap.html">Json2Ldap 1.4</a>, released yesterday, simplifies its <a href="http://software.dzhuvinov.com/json-rpc-2.0.html">JSON-RPC 2.0</a> API to become an even friendlier web service for working with LDAP compatible back-end directories.</p>
<p>The calls to make plain, secure and default LDAP connections are now merged into a single RPC method named <code><a href="http://software.dzhuvinov.com/json2ldap-api.html#ldap.connect">ldap.connect</a></code>.</p>
<p>To make a connection to the default LDAP server (specified in the Json2Ldap <a href="http://software.dzhuvinov.com/json2ldap-configuration.html">configuration</a> file by the admin) just send an <code><a href="http://software.dzhuvinov.com/json2ldap-api.html#ldap.connect">ldap.connect</a></code> request with no parameters:</p>
<pre>
{ "id" : 1,
  <strong>"method" : "ldap.connect"</strong>,
  "jsonrpc" : "2.0"
}
</pre>
<p>To make a plain LDAP connection to a particular directory server specify its host and port:</p>
<pre>
{ "id" : 1,
  <strong>"method" : "ldap.connect"</strong>,
  "params" : { <strong>"port" : 1389, "host" : "dir.example.com"</strong> },
  "jsonrpc" : "2.0"
}
</pre>
<p>To make a secure (encrypted) connection, set the optional security parameter to <code>StartTLS</code> or <code>SSL</code>. You may also set the optional <code>trustSelfSignedCerts</code> parameter:</p>
<pre>
{ "id" : 1,
  <strong>"method" : "ldap.connect"</strong>,
  "params" : { <strong>"host" : "192.168.0.1",
               "port" : 1389,
               "security" : "StartTLS",
               "trustSelfSignedCerts" : true</strong> },
  "jsonrpc":"2.0"
}
</pre>
<p>The full description of the <code>ldap.connect</code> JSON-RPC call is available in the online <a href="http://software.dzhuvinov.com/json2ldap-api.html#ldap.connect">API docs</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dzhuvinov.com/?feed=rss2&amp;p=373</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Json2Ldap gets mentioned in Network World</title>
		<link>http://blog.dzhuvinov.com/?p=359</link>
		<comments>http://blog.dzhuvinov.com/?p=359#comments</comments>
		<pubDate>Wed, 28 Jul 2010 10:47:25 +0000</pubDate>
		<dc:creator>Vladimir Dzhuvinov</dc:creator>
				<category><![CDATA[JSON]]></category>
		<category><![CDATA[JSON-RPC]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://blog.dzhuvinov.com/?p=359</guid>
		<description><![CDATA[Thanks to Dave Kearns for mentioning Json2Ldap in his last week's IdM newsletter for Network World. I hope that would help towards making the software more popular. Since its 1.0 release at the end of April 2010 initial sales have been rather disappointing. I suppose this has got to do with Json2Ldap being a truly [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.dzhuvinov.com/wp-content/uploads/2010/06/icon-json2ldap-128x128.png"><img src="http://blog.dzhuvinov.com/wp-content/uploads/2010/06/icon-json2ldap-128x128.png" alt="Json2Ldap icon" title="icon-json2ldap-128x128" width="128" height="128" class="alignleft size-full wp-image-291" /></a>Thanks to Dave Kearns for mentioning <a href="http://software.dzhuvinov.com/json2ldap.html">Json2Ldap</a> in his last week's IdM <a href="http://www.networkworld.com/newsletters/dir/2010/071910id2.html">newsletter</a> for Network World. I hope that would help towards making the software more popular.</p>
<p>Since its <a href="http://blog.dzhuvinov.com/?p=96">1.0 release</a> at the end of April 2010 initial sales have been rather disappointing. I suppose this has got to do with Json2Ldap being a truly novel product, so potential clients wouldn't even suspect that such a solution existed. Directory services are typically regarded as a "deep" back-end function and few people involved with LDAP and IdM probably imagine that they can be exposed as a web service in a simple and elegant way. I guess it would take some time and campaigning to change this mindset.</p>
<p>So currently I'm looking for a partner to step up the marketing of Json2Ldap so I can go back to my real job, the greater Transaction Company software project. The LDAP web gateway/proxy was, after all, just a side-product of this project, but still, why not take advantage and its uniqueness and usefulness and help it grow into a popular product on its own?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dzhuvinov.com/?feed=rss2&amp;p=359</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Which LDAP servers support the &quot;Who am I?&quot; extended operation?</title>
		<link>http://blog.dzhuvinov.com/?p=352</link>
		<comments>http://blog.dzhuvinov.com/?p=352#comments</comments>
		<pubDate>Fri, 16 Jul 2010 08:33:50 +0000</pubDate>
		<dc:creator>Vladimir Dzhuvinov</dc:creator>
				<category><![CDATA[LDAP]]></category>

		<guid isPermaLink="false">http://blog.dzhuvinov.com/?p=352</guid>
		<description><![CDATA[The extended "Who am I?" operation, defined in RFC 4532, allows an LDAP client to retrieve the bind DN associated with the current connection. This ext. op. can be useful in situations where an authenticated (via bind) LDAP connection is shared by several clients: the client that issued the authentication request would certainly know the [...]]]></description>
			<content:encoded><![CDATA[<p>The extended "Who am I?" operation, defined in RFC 4532, allows an LDAP client to retrieve the bind DN associated with the current connection.</p>
<p>This ext. op. can be useful in situations where an authenticated (via bind) LDAP connection is shared by several clients: the client that issued the authentication request would certainly know the bind DN, but the other clients may not - the "Who am I?" mechanism provides them with a mean to find out the user's identity.</p>
<p>The "Who am I?" RFC was published in June 2006. As of 2010 the following popular LDAP v3 compatible servers claim support for it:</p>
<ul>
<li>Active Directory from Microsoft, starting from Windows Server 2008, in the format <code>DOMAIN/user</code></li>
<li>Novell eDirectory</li>
<li>OpenDS</li>
<li>OpenLDAP</li>
<li>Sun Directory Server</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.dzhuvinov.com/?feed=rss2&amp;p=352</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
