<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>SMART - Student-Managed Access to Online Resources</title>
	<atom:link href="http://smartjisc.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://smartjisc.wordpress.com</link>
	<description>Student-Managed Access to Online Resources</description>
	<lastBuildDate>Fri, 19 Oct 2012 10:42:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='smartjisc.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>SMART - Student-Managed Access to Online Resources</title>
		<link>http://smartjisc.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://smartjisc.wordpress.com/osd.xml" title="SMART - Student-Managed Access to Online Resources" />
	<atom:link rel='hub' href='http://smartjisc.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Secure sharing of Higher Education Achievement Reports (HEARs) at Newcastle University using SMART</title>
		<link>http://smartjisc.wordpress.com/2012/10/05/secure-sharing-of-higher-education-achievement-reports-hears-at-newcastle-university-using-smart/</link>
		<comments>http://smartjisc.wordpress.com/2012/10/05/secure-sharing-of-higher-education-achievement-reports-hears-at-newcastle-university-using-smart/#comments</comments>
		<pubDate>Fri, 05 Oct 2012 12:43:01 +0000</pubDate>
		<dc:creator>maciejmachulak</dc:creator>
				<category><![CDATA[Publications]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://smartjisc.wordpress.com/?p=747</guid>
		<description><![CDATA[We&#8217;ve just released a draft version of the &#8220;Secure sharing of Higher Education Achievement Reports (HEARs) at Newcastle University using SMART&#8221; document. Our goal is to propose improvements to existing processes at Newcastle University and integrate SMART with some of the applications, as discussed. Please feel free to send your feedback. You can also check [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=747&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>We&#8217;ve just released a draft version of the &#8220;<a href="http://smartjisc.files.wordpress.com/2012/10/smart_hears_draft012.pdf">Secure sharing of Higher Education Achievement Reports (HEARs) at Newcastle University using SMART</a>&#8221; document. Our goal is to propose improvements to existing processes at Newcastle University and integrate SMART with some of the applications, as discussed. Please feel free to send your feedback.<a title="here" href="http://smartjisc.files.wordpress.com/2012/10/smart_hears_draft01.pdf"><br />
</a></p>
<p><a title="SMART White Paper" href="http://smartjisc.files.wordpress.com/2012/10/smart_white_paper.pdf" target="_blank"><br />
</a>You can also check out <a href="http://smartjisc.files.wordpress.com/2012/10/smart_white_paper.pdf"><span class="GRcorrect" id="GRmark_0a083e3c3cb351d2f9b2299f9df45522bc180413_SMART white paper:0">SMART white paper</span></a> - single page that describes the problems in Higher Education that SMART AM solves.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smartjisc.wordpress.com/747/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smartjisc.wordpress.com/747/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=747&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smartjisc.wordpress.com/2012/10/05/secure-sharing-of-higher-education-achievement-reports-hears-at-newcastle-university-using-smart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/8cd0a485adb87d2df8543cc6966c943c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maciejmachulak</media:title>
		</media:content>
	</item>
		<item>
		<title>Puma: building a requester application</title>
		<link>http://smartjisc.wordpress.com/2012/06/30/puma-building-a-requester-application/</link>
		<comments>http://smartjisc.wordpress.com/2012/06/30/puma-building-a-requester-application/#comments</comments>
		<pubDate>Sat, 30 Jun 2012 11:50:27 +0000</pubDate>
		<dc:creator>maligree</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://smartjisc.wordpress.com/?p=603</guid>
		<description><![CDATA[Here comes the second part of our hands-on introduction to our lovable Python UMA implementation &#8211; PUMA. As Part I, it may not be all that brief, but it is wildly comprehensive and grants you the hottest superpower on the market: rapidly creating sleek, UMA-enabled Requester Applications. Architecture overview Just like with the host application, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=603&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><a name="requester-arch"></a></p>
<p>Here comes the second part of our hands-on introduction to our lovable Python UMA implementation &#8211; PUMA. As Part I, it may not be all that brief, but it is wildly comprehensive and grants you the hottest superpower on the market: rapidly creating sleek, UMA-enabled Requester Applications.</p>
<p><span id="more-603"></span></p>
<h1>Architecture overview</h1>
<p>Just like with the host application, the requester app also has a central linking entity that is used to identify a user &#8211; <code>RequestingParty</code>. A <code>RequestingParty</code> will need an access token for each AM it interacts with, hence: multiple <code>RequesterAccessToken</code> entities. Every entity of this type is of course linked to an <code>AuthorizationManager</code> entity that represents the AM the token pertains to.</p>
<p><a href="http://smartjisc.files.wordpress.com/2012/06/erdrequester.png"><img src="http://smartjisc.files.wordpress.com/2012/06/erdrequester.png?w=595" alt="" title="ERDRequester"   class="aligncenter size-full wp-image-736" /></a></p>
<p>So, let&#8217;s talk about tokens. The requester application has to deal with two types of tokens:</p>
<dl>
<dt>AM tokens</dt>
<dd>these are regular OAuth tokens. There&#8217;s one per a requesting party-AM pair. This one allows you to access the AM&#8217;s endpoints.</dd>
<dt>RPT</dt>
<dd>these are used to access resources at the host applications. You will have at least* one per host. You obtain these by asking the AM for it; and for that you need to have the AM token first.</dd>
</dl>
<p>There&#8217;s a family of calls that will let you obtain, set, change, update, retrieve (and so on) these tokens, so you need not worry about storing them.</p>
<h1>What the flow (usually) looks like</h1>
<p>Check out this neat graph to get an idea of what the code flow in a requester application looks like. Remember that your mileage may vary slightly.</p>
<p><img src="http://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgRmlyc3QtdGltZSBmbG93CgpSZXF1ZXN0aW5nIFBhcnR5LT4ACwdlcjogZmV0Y2ggbWUgJFVSSQpub3RlIHJpZ2h0IG9mIAAcC3IAPgYgd2l0aG91dCBhbnkgdG9rZW4gaXMgbWFkZQBeCGVyLT5Ib3N0MTogcGxhaW4gSFRUUAA2CWZvcgBjBgAeBQB8DXJlc291cmNlIGlzIFVNQSBwcm90ZWN0ZWQ7IGFzayBBTTEAVwwAgUQQOiByZWRpcmVjdCB0byBBTSBhdXRoeiBwYWcAgREJAIF1C0F1dGhvcml6YXRpb24gTWFuYWdlcjoALQdkaWFsb2cKAA8VAFkgY2FsbGJhY2sgQACCKghlcgCCYh4AKggAgjQMAIEIF2NoYW5nZQCBUwdjb2RlAIJKBWFjY2VzcwCDBgcoT0F1dGgpAIEeHwCDRgtlADMOAGMjAINwBgCDRAVob3N0LCBwbGVhc2UAUCM8ACwPPgCEIRMkVVJJAEsHICgAhFoHbmNsdWRlZCkAhQ8PAIRfB2NoZWNrcyBwZXJtaXNzaW9ucwCFKAVpcmVkAIRQH3BvbnMAhSsNAIRBFACFDwY&amp;s=vs2010" alt="" width="100%" /><br />
<!-- http://www.websequencediagrams.com/?lz=dGl0bGUgRmlyc3QtdGltZSBmbG93CgpSZXF1ZXN0aW5nIFBhcnR5LT4ACwdlcjogZmV0Y2ggbWUgJFVSSQpub3RlIHJpZ2h0IG9mIAAcC3IAPgYgd2l0aG91dCBhbnkgdG9rZW4gaXMgbWFkZQBeCGVyLT5Ib3N0MTogcGxhaW4gSFRUUAA2CWZvcgBjBgAeBQB8DXJlc291cmNlIGlzIFVNQSBwcm90ZWN0ZWQ7IGFzayBBTTEAVwwAgUQQOiByZWRpcmVjdCB0byBBTSBhdXRoeiBwYWcAgREJAIF1C0F1dGhvcml6YXRpb24gTWFuYWdlcjoALQdkaWFsb2cKAA8VAFkgY2FsbGJhY2sgQACCKghlcgCCYh4AKggAgjQMAIEIF2NoYW5nZQCBUwdjb2RlAIJKBWFjY2VzcwCDBgcoT0F1dGgpAIEeHwCDRgtlADMOAGMjAINwBgCDRAVob3N0LCBwbGVhc2UAUCM8ACwPPgCEIRMkVVJJAEsHICgAhFoHbmNsdWRlZCkAhQ8PAIRfB2NoZWNrcyBwZXJtaXNzaW9ucwCFKAVpcmVkAIRQH3BvbnMAhSsNAIRBFACFDwY&amp;s=vs2010 --></p>
<p>Subsequent requests are simpler.</p>
<p><img src="http://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgUmVxdWVzdGVyIGZsb3c7IGNhc2U6IEFNIHRva2VuIGFscmVhZHkgcHJlc2VudC4KCgAqB2luZyBQYXJ0eS0-ADoJOiBmZXRjaCBtZSAkVVJJCm5vdGUgcmlnaHQgb2YAYAo6IHIAbwYgd2l0aG91dCBhbnkAaQdpcyBtYWRlAF4IZXItPkhvc3QxOiBwbGFpbiBIVFRQADYJZm9yAGMGAB4FAHwNcmVzb3VyY2UgaXMgVU1BIHByb3RlY3RlZCBieSBBTTEKCmFsdCBSUCBoYXMgYQCBZgdmb3IgdGhpcyBob3N0AIFzCAogICAAghwKAIEGCQCBOwgkVVJJAIFDBQCBOQhuY2wuCmVsc2Ugbm8ARAUtc3BlY2lmaWMAgkwHeWV0AEQQQXV0aG9yaXphdGlvbiBNYW5hZ2VyOiBhc2sAgwAHZGlzcGVuc2VyIGVuZHBvaW4AgXcGAIEkFQCBLAUAPRUAgx4NbmV3AINeBgplbmQAg04JAIJmCwCBVQVwbGVhc2UgKACBUwp1ZGVkKQCCaggAgSIXY2hlY2tzIHBlcm1pc3Npb25zAINuBWlyZWQAgysKAIEMFwCDaAcAhHkGc3RhdHVzAINKFnBvbnNlCgpvcHQgaW5zdWZmaWNpZW50AGoMAII9KwCDdwUAhW4FdXBncmFkZQCCICcAhhIHIGxpcwCFYQUAgV8JY2xhaW0AWigAIgsAgxgiAIEaB2QgdGljawCEOxIAgysUACkKAIJLfQCEWhAAiDwQAIcuCgoK&amp;s=vs2010" alt="" /><br />
<!--http://www.websequencediagrams.com/?lz=dGl0bGUgUmVxdWVzdGVyIGZsb3c7IGNhc2U6IEFNIHRva2VuIGFscmVhZHkgcHJlc2VudC4KCgAqB2luZyBQYXJ0eS0-ADoJOiBmZXRjaCBtZSAkVVJJCm5vdGUgcmlnaHQgb2YAYAo6IHIAbwYgd2l0aG91dCBhbnkAaQdpcyBtYWRlAF4IZXItPkhvc3QxOiBwbGFpbiBIVFRQADYJZm9yAGMGAB4FAHwNcmVzb3VyY2UgaXMgVU1BIHByb3RlY3RlZCBieSBBTTEKCmFsdCBSUCBoYXMgYQCBZgdmb3IgdGhpcyBob3N0AIFzCAogICAAghwKAIEGCQCBOwgkVVJJAIFDBQCBOQhuY2wuCmVsc2Ugbm8ARAUtc3BlY2lmaWMAgkwHeWV0AEQQQXV0aG9yaXphdGlvbiBNYW5hZ2VyOiBhc2sAgwAHZGlzcGVuc2VyIGVuZHBvaW4AgXcGAIEkFQCBLAUAPRUAgx4NbmV3AINeBgplbmQAg04JAIJmCwCBVQVwbGVhc2UgKACBUwp1ZGVkKQCCaggAgSIXY2hlY2tzIHBlcm1pc3Npb25zAINuBWlyZWQAgysKAIEMFwCDaAcAhHkGc3RhdHVzAINKFnBvbnNlCgpvcHQgaW5zdWZmaWNpZW50AGoMAII9KwCDdwUAhW4FdXBncmFkZQCCICcAhhIHIGxpcwCFYQUAgV8JY2xhaW0AWigAIgsAgxgiAIEaB2QgdGljawCEOxIAgysUACkKAIJLfQCEWhAAiDwQAIcuCgoK&amp;s=vs2010--></p>
<p><img alt="" width="100%" /></p>
<h1>Discovery</h1>
<p>This part is identical to what is described in the &#8220;host&#8221; section (well, you may be interested in different endpoints, but the method is the same). Check it out. <a class="arrow" href="#discovery">➶</a></p>
<p><a name="token"></a></p>
<h1>Getting a token</h1>
<p>Thankfully, same as host-side. <a class="arrow" href="#token">➶</a></p>
<h1>For starters: making a regular HTTP request</h1>
<p>Assume that the user of the requester application (the requesting party, if you will) tells the application to fetch what&#8217;s under this URI:</p>
<blockquote><p><a href="https://pumahostone.appspot.com/api/people/alice/personal/name" rel="nofollow">https://pumahostone.appspot.com/api/people/alice/personal/name</a></p></blockquote>
<p>In order to act smart, it makes sense to first do a pre-flight request for the resource and see how the server responds. We&#8217;re not really interested in the data itself right now, as we <em>expect</em> the request to fail, but the response headers (especially <code>WWW-Authenticate</code>) should contain some really valuable information. So let&#8217;s make a pre-flight (note: it&#8217;s a <code>HEAD</code> request):</p>
<p><pre class="brush: python; wrap-lines: false;">
uri = &quot;https://pumahostone.appspot.com/api/people/alice/personal/name&quot;
response = Puma.Util.preflight_request(uri)
</pre></p>
<p><code>response</code> will be an <code>httplib.HTTPResponse</code> object. Two things you&#8217;ll want to check for to make sure the object is UMA protected:</p>
<ul>
<li>response status is <code>401</code></li>
<li>there&#8217;s an UMA-flavored <code>WWW-Authenticate</code> header set, with the name of the AM protecting the resource you just asked for. So you know who to ask for access.</li>
</ul>
<p>For example (a bit of code from the <a href="https://pumarequesterone.appspot.com">pumarequesterone</a> application):</p>
<p><pre class="brush: python; wrap-lines: false;">
if response.status == 401 and Puma.Util.check_www_auth_header(response):
    am_data = Puma.Util.check_www_auth_header(response)
    am = Puma.UMA.discover_am_from_www_auth(am_data)
</pre></p>
<p>Something to note about the last line: if the AM had already been discovered, it will simply return the existing AM object from the storage layer.</p>
<p>Now that we have <code>am</code>, we check if we&#8217;re <a href="#dynamic-registration">OAuth-registered</a> (and if not, we register):</p>
<p><pre class="brush: python; wrap-lines: false;">
if not am.client_id and not am.client_secret:
    registration_data = Puma.Pouches.RegistrationData()
    registration_data.client_description = &quot;Puma, Requester One.&quot;
    registration_data.client_icon = &quot;&quot;
    registration_data.client_url = &quot;https://pumarequesterone.appspot.com&quot;
    registration_data.client_name = &quot;Puma Requester One&quot;
    registration_data.redirect_url = &quot;https://pumarequesterone.appspot.com/callback&quot;

    Puma.OAuth.oauth_registration(am, registration_data)
</pre></p>
<p>Now we have the AM out of the way. We&#8217;re confident the application is properly set up to talk to it, now let&#8217;s make sure the user (also called the Requesting Party, RP for short) is just as ready:</p>
<p><pre class="brush: python; wrap-lines: false;">
# user_key is the logged-in user's unique identifier

rp = Puma.Util.check_if_user_has_requesting_party_identity(user_key)
if rp is None:
    # first time UMA interaction
    rp = Puma.Util.create_requesting_party_identity(user_key)
</pre></p>
<p>A <code>RequestingParty</code> &#8220;identity&#8221; (an object) is the requester-equivalent of an UMAUser. Refer to the <a href="#requester-arch">architecture overview</a> if your memory fails you (or you skipped it and are now helplessly scratching your head).</p>
<p>Great. Now, the <code>RequesterAccessToken</code> entity has a dichotomous role:</p>
<ul>
<li>contains the AAT</li>
<li>contains a set of RPTs (internally called an RPT wallet, such an unimaginative name..)</li>
</ul>
<p>Let&#8217;s leave that for now. We need a <code>RequestingParty</code>, with the AAT. How is an AAT obtained? Well, it&#8217;s a regular OAuth token, so, naturally, you have to send the user through an OAuth flow. Code should look familiar:</p>
<p><pre class="brush: python; wrap-lines: false;">
rat = Puma.Storage.get_rat_for_am(rp, am) #
if rat is None:
    Puma.Util.set_pending_registration(rp, am)
    self.redirect(Puma.OAuth.get_rat_authz_uri_for_am(am, 'https://pumarequesterone.appspot.com/callback'))
    return
</pre></p>
<p>Callback expects an authorization code grant will be passed to it via the <code>code</code> parameter:</p>
<p><pre class="brush: python; wrap-lines: false;">
#::-- inside callback handler ('/callback')

code = self.request.get(&quot;code&quot;)
if code:
Puma.OAuth.trade_code_for_rat_and_store(
current_user_key,
code,
&quot;https://pumarequesterone.appspot.com/callback&quot;,
)

session.set_flash(&quot;Callback redirect you here. You should have a requester token now.&quot;)
self.redirect('/')
#::--
</pre></p>
<p>TBD</p>
<p><pre class="brush: python; wrap-lines: false;">
host_id = am_data[&quot;host_id&quot;]
rpt = Puma.Util.get_rpt_for_host_id(rp, am, host_id)
if not rpt:
    rpt = Puma.Util.obtain_and_store_rpt_for_host_id(rp, am, host_id)

urlparsed = urlparse(resource_uri)

if urlparsed.scheme == 'https':
    hx = httplib.HTTPSConnection(urlparsed.netloc)
else:
    hx = httplib.HTTPConnection(urlparsed.netloc)

headers = {
    'Authorization': 'Bearer ' + str(rpt),
}

hx.request('GET', urlparsed.path, '', headers)

re = hx.getresponse()
</pre></p>
<p>This sends a token-equipped (RPT-equipped) HTTP request to the host application. The response will generally be one of:</p>
<ul>
<li><code>HTTP 200 (OK)</code>: the host application determined that the token has enough permissions assigned to it, and allowed access; the response body is the requested resource.</li>
<li><code>HTTP 403 (Forbidden)</code>: the token is fine &amp; valid, but it doesn&#8217;t have the required permissions associated with it yet. The response will contain a <code>WWW-Authenticate</code><br />
header, with the <code>ticket</code> parameter set. This <code>ticket</code> will be used to upgrade (i.e. assign new permissions to a token).</li>
</ul>
<p>Since the <code>403</code> response is practically guaranteed to be the response with a freshly-acquired RPT, here&#8217;s the code that handles it:</p>
<p><pre class="brush: python; wrap-lines: false;">
if re.status == 403:
www_auth = re.getheader('www-authenticate')
ticket = Puma.Util.ticket_from_www_auth(www_auth)

claims_requested = Puma.UMA.send_ticket_to_claims_endpoint(rat, ticket, www_auth)
# claims_requested will be an array of claims that the requester needs to provide in order to get access

# at the moment, there's only one type of claim that you will encounter:
# that's redirect_required, which asks for a redirect that validates your identity at the AM.
for claim in claims_requested:
if claim['claim_type'] == 'redirect_required':
logging.info(&quot;Redirecting to %s&quot; % claim['claim_value'])
self.redirect(claim['claim_value'])
</pre></p>
<p>After the redirect is complete, you should end up back at the requester application, your RPT now bearing new powers. You should now try to access the resource again (this can be automated &#8211; look at the code for <code>/callback</code> to see the trickery.</p>
<p>This time the request should be a <code>200 OK</code>:</p>
<p><pre class="brush: python; wrap-lines: false;">
if re.status == 200:
    # resource requested in response body
    response_body = re.read()
</pre></p>
<p>And you&#8217;re done.</p>
<h1>An insight into PumaRequesterOne: the tiny mighty callback handler</h1>
<p>Apart from acting as a regular OAuth 2.0 callback handler, the requester&#8217;s <code>/callback</code> also needs to double as a permission upgrade redirect handler (vague? see previous paragraphs about the <code>redirect_required</code> claim).</p>
<p>So <code>/callback</code> handles four cases, as outlined below:</p>
<p><pre class="brush: python; wrap-lines: false;">
class RequesterCallbackHandler(webapp.RequestHandler):
    def get(self):

    #
    # two ways through this:
    # - regular OAuth flow (code)
    # - claims flow (x-oauth_*):
    # ~ alice to alice
    # ~ alice to bob
    #

    code = self.request.get(&quot;code&quot;)
    x_oauth_access_granted = self.request.get(&quot;x-oauth_access_granted&quot;) # alice-to-alice
    x_oauth_access_req = self.request.get(&quot;x-oauth_access_req&quot;) # alice-to-bob
    claim_status = self.request.get(&quot;claim_status&quot;) # openid claim

    if code:
        # standard OAuth 2.0 flow

    elif x_oauth_access_granted:
        # post-claims redirect; access granted (Alice-to-Alice)

    elif x_oauth_access_req:
        # post-claims redirect; access requested (Alice-to-Bob)

    elif claim_status:
        #

    else:
        # fallback.

    if session['transaction_type'] == 'fetch':
        self.redirect('/fetch')
    elif session['transaction_type'] == 'update':
        self.redirect('/update')
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smartjisc.wordpress.com/603/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smartjisc.wordpress.com/603/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=603&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smartjisc.wordpress.com/2012/06/30/puma-building-a-requester-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/309687c012d0ca8df31597cfeec5ce35?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maligree</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2012/06/erdrequester.png" medium="image">
			<media:title type="html">ERDRequester</media:title>
		</media:content>

		<media:content url="http://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgRmlyc3QtdGltZSBmbG93CgpSZXF1ZXN0aW5nIFBhcnR5LT4ACwdlcjogZmV0Y2ggbWUgJFVSSQpub3RlIHJpZ2h0IG9mIAAcC3IAPgYgd2l0aG91dCBhbnkgdG9rZW4gaXMgbWFkZQBeCGVyLT5Ib3N0MTogcGxhaW4gSFRUUAA2CWZvcgBjBgAeBQB8DXJlc291cmNlIGlzIFVNQSBwcm90ZWN0ZWQ7IGFzayBBTTEAVwwAgUQQOiByZWRpcmVjdCB0byBBTSBhdXRoeiBwYWcAgREJAIF1C0F1dGhvcml6YXRpb24gTWFuYWdlcjoALQdkaWFsb2cKAA8VAFkgY2FsbGJhY2sgQACCKghlcgCCYh4AKggAgjQMAIEIF2NoYW5nZQCBUwdjb2RlAIJKBWFjY2VzcwCDBgcoT0F1dGgpAIEeHwCDRgtlADMOAGMjAINwBgCDRAVob3N0LCBwbGVhc2UAUCM8ACwPPgCEIRMkVVJJAEsHICgAhFoHbmNsdWRlZCkAhQ8PAIRfB2NoZWNrcyBwZXJtaXNzaW9ucwCFKAVpcmVkAIRQH3BvbnMAhSsNAIRBFACFDwY&#38;s=vs2010" medium="image" />

		<media:content url="http://www.websequencediagrams.com/cgi-bin/cdraw?lz=dGl0bGUgUmVxdWVzdGVyIGZsb3c7IGNhc2U6IEFNIHRva2VuIGFscmVhZHkgcHJlc2VudC4KCgAqB2luZyBQYXJ0eS0-ADoJOiBmZXRjaCBtZSAkVVJJCm5vdGUgcmlnaHQgb2YAYAo6IHIAbwYgd2l0aG91dCBhbnkAaQdpcyBtYWRlAF4IZXItPkhvc3QxOiBwbGFpbiBIVFRQADYJZm9yAGMGAB4FAHwNcmVzb3VyY2UgaXMgVU1BIHByb3RlY3RlZCBieSBBTTEKCmFsdCBSUCBoYXMgYQCBZgdmb3IgdGhpcyBob3N0AIFzCAogICAAghwKAIEGCQCBOwgkVVJJAIFDBQCBOQhuY2wuCmVsc2Ugbm8ARAUtc3BlY2lmaWMAgkwHeWV0AEQQQXV0aG9yaXphdGlvbiBNYW5hZ2VyOiBhc2sAgwAHZGlzcGVuc2VyIGVuZHBvaW4AgXcGAIEkFQCBLAUAPRUAgx4NbmV3AINeBgplbmQAg04JAIJmCwCBVQVwbGVhc2UgKACBUwp1ZGVkKQCCaggAgSIXY2hlY2tzIHBlcm1pc3Npb25zAINuBWlyZWQAgysKAIEMFwCDaAcAhHkGc3RhdHVzAINKFnBvbnNlCgpvcHQgaW5zdWZmaWNpZW50AGoMAII9KwCDdwUAhW4FdXBncmFkZQCCICcAhhIHIGxpcwCFYQUAgV8JY2xhaW0AWigAIgsAgxgiAIEaB2QgdGljawCEOxIAgysUACkKAIJLfQCEWhAAiDwQAIcuCgoK&#38;s=vs2010" medium="image" />
	</item>
		<item>
		<title>Puma: building a host application</title>
		<link>http://smartjisc.wordpress.com/2012/04/20/puma-building-a-host-application/</link>
		<comments>http://smartjisc.wordpress.com/2012/04/20/puma-building-a-host-application/#comments</comments>
		<pubDate>Fri, 20 Apr 2012 08:01:10 +0000</pubDate>
		<dc:creator>maligree</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://smartjisc.wordpress.com/?p=600</guid>
		<description><![CDATA[What you see here is the first part of our hands-on introduction to our lovable Python UMA implementation. It may not be all that brief, but it is wildly comprehensive and grants you the hottest superpower on the market: rapidly creating sleek, UMA-enabled applications. Let&#8217;s get to work, then. Terminology Before we talk, we need [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=600&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>What you see here is the first part of our hands-on introduction to our lovable Python UMA implementation. It may not be all that brief, but it is wildly comprehensive and grants you the hottest superpower on the market: rapidly creating sleek, UMA-enabled applications.</p>
<p>Let&#8217;s get to work, then.</p>
<p><span id="more-600"></span></p>
<h2>Terminology</h2>
<p>Before we talk, we need to establish some fundamental terminology:</p>
<ul>
<li><strong>host application</strong>: a regular web application that hosts data of some kind (which you would be interested in sharing) &#8212; be it pictures, your grades, your personal data, anything.</li>
<li><strong>requester application</strong>: a web application that would like to use data hosted by another application (the host application, described above)</li>
<li><strong>authorization manager</strong>: at the very center of UMA sits the authorization manager. The essential piece of the puzzle &#8212; you should <a href="http://kantarainitiative.org/confluence/display/uma/Home">check UMA&#8217;s wiki for a wealth of information</a>.</li>
<li><strong>PAT</strong>: protection API token (previously: host access token). A simple OAuth 2.0 access token; used by the hosting application to interact with the AM.</li>
<li><strong>AAT</strong>: authorization API token (previously: requester access token). A simple OAuth 2.0 access token; used by the requesting application to interact with the AM to identify the requesting party (the user of the requesting application)</li>
<li><strong>RPT</strong>: requester permission token. A token used for representing permissions over at particular host. This is the token that is used during any UMA interaction between the host and requester applications.</li>
<li><strong>policy</strong>: a setting at the AM that describes who can access what; for example: &#8220;Alice@gmail.com can access my calendar&#8221;</li>
<li><strong>token upgrade</strong>: we say a token is upgraded when new permissions are assigned to it</li>
</ul>
<h2>Custom MIME types</h2>
<p>Look through the list. This should give you an overview of the messages used in UMA.</p>
<ul>
<li><strong>application/uma-scope+json</strong>: represents an UMA scope</li>
<li><strong>application/uma-resource-set+json</strong>: represents a resource set description</li>
<li><strong>application/uma-status+json</strong>: represents a response containing information about the status of a token</li>
<li><strong>application/uma-requested-permission+json</strong>: used when the host asks the AM to issue a new ticket to allow token upgrade.</li>
<li><strong>application/uma-permission-ticket+json</strong>: indicates that the response contains a ticket &#8211; an opaque value that can be used by the requester application to add new permissions to a token.</li>
<li><strong>application/uma-access-token+json</strong>: indicates that the response contains a new token. For example, this is the case when the requesting application asks the AM to issue an RPT for a new host.</li>
</ul>
<h2>Puma&#8217;s anatomy</h2>
<p>Visualization is key!</p>
<p><img src="http://smartjisc.files.wordpress.com/2012/04/pumaanatomy.png?w=595" alt="" title="Puma&#039;s anatomy"   class="aligncenter size-full wp-image-738" /></a></p>
<p>As you may have somehow noticed, calls and objects are split into five categories:</p>
<ul>
<ul>
<ul>
<li><strong>Puma.UMA.*</strong>- the essence of UMA. Resource management, token handling &#8212; here&#8217;s the place.
<ul class="inner-list">
<li>.discover_am_endpoints(&#8230;)</li>
<li>.register_resource(&#8230;)</li>
<li>.check_token_status(&#8230;)</li>
<li>&#8230; et al</li>
</ul>
</li>
<li><strong>Puma.OAuth.*</strong>- everything that pertains to the OAuth-flavored side of UMA, bespoken for Puma. From trading grants, via tokens, all the way to gluing together those authorization URLs.
<ul class="inner-list">
<li>.get_authz_uri(&#8230;)</li>
<li>.trade_code_for_hat_and_store(&#8230;)</li>
<li>.refresh_token(&#8230;)</li>
<li>&#8230; et al</li>
</ul>
</li>
<li><strong>Puma.Util.*</strong>- utility functions for Puma. Not merely optional helpers, so be sure to pay attention to these.
<ul class="inner-list">
<li>.get_owner_of_resource(&#8230;)</li>
<li>&#8230; et al</li>
</ul>
</li>
<li><strong>Puma.Storage.*</strong> &#8211; an attempt to abstract away from the reality of the underlying data storage mechanisms.</li>
<li><strong>Puma.Pouches.*</strong>- objects that act as containers and help you make sure that all those calls get just the data they need. Simple as that.
<ul class="inner-list">
<li>.ResourceSetDescription</li>
<li>.RegistrationData</li>
<li>&#8230; et al</li>
</ul>
</li>
</ul>
</ul>
</ul>
<h2>Host application</h2>
<p>Imagine an application that stores some of your most often used personal data (perhaps an address? or list of schools attended?); imagine also that the application can expose your data the the world via a RESTful API, such that &#8211; just as an example &#8211; your home address would be accessible under..</p>
<blockquote><p><a href="https://app.example.com/people/alice/address/home" rel="nofollow">https://app.example.com/people/alice/address/home</a></p></blockquote>
<p>For example, on our own Puma Host One, Alice&#8217;s home address is available under:</p>
<blockquote><p><a href="https://pumahostone.appspot.com/api/people/alicja/address/home" rel="nofollow">https://pumahostone.appspot.com/api/people/alicja/address/home</a></p></blockquote>
<p><a name="host-arch"></a></p>
<h2>Architecture overview</h2>
<p>So it&#8217;s assumed that the application has <span class="u">some notion of users/accounts, and that users are uniquely identifiable by an ID of some sort. That is the only part of the application&#8217;s infrastructure that Puma needs to be able to tap into (and even this in a very superficial and completely non-intrusive manner). How it builds on top of that can be seen below (explanation follows, of course):</span></p>
<p><img src="http://smartjisc.files.wordpress.com/2012/04/erd.png?w=595" alt="" title="Host ERD"   class="aligncenter size-full wp-image-741" /></a>&#8221; alt=&#8221;" width=&#8221;90%&#8221; /&gt;</p>
<p>Let&#8217;s step through this:</p>
<dl>
<dt><code>AuthorizationManager</code></dt>
<dd>These entities hold information about known (discovered) authorization managers. The data they hold is related to the two phases an AM introduction process goes through:</p>
<ul>
<li>discovery: the AM&#8217;s endpoints (in other words, the API), used to register resources, do token magic and so on.</li>
<li>registration: the AM&#8217;s [OAuth] credentials, most importantly the <code>client_id</code> and <code>client_secret</code></li>
</ul>
</dd>
<dt><code>ResourceMap</code></dt>
<dd>A single <code>ResourceMap</code> entity represents and holds information on a resource, existing on the host, that has been set up for protection with UMA.<br />
Data stored includes, among others..</p>
<ul>
<li>the resource URI</li>
<li>the ID of the resource</li>
<li>the resource name &amp; short description (optional)</li>
</ul>
</dd>
<dt><code>UMAUser</code></dt>
<dd>Of course, the aforementioned entities need to be linked together somehow. After all, we&#8217;ll be asking questions such as:</p>
<ul>
<li>what AM does <code>$user</code> want to use?</li>
<li>who owns a <code>ResourceMap</code>?</li>
<li>&#8230; and obviously many more (but they&#8217;re all just as trivial)</li>
</ul>
<p>Enter <code>UMAUser</code>. The user&#8217;s UMA-powered alter-ego identity on the host application.<br />
It has a monogamous relation (<code>has</code>) with an <code>AuthorizationManager</code>, an outside <code>User</code> entity; as well as a polygamous (<code>has-many</code>) relationship with <code>ResourceMap</code>s.</p>
</dd>
</dl>
<p>Simple enough. Let&#8217;s get some action.</p>
<h2>Discovery</h2>
<p>Any application that wishes to talk with the AM must first learn about its endpoints; each endpoint has a well-defined, specific role to fulfill. The go-to place for learning about the AM’s endpoints is always:</p>
<blockquote><p><a href="http://www.smartam.net/.well-known/uma-configuration" rel="nofollow">http://www.smartam.net/.well-known/uma-configuration</a></p></blockquote>
<p>While you don&#8217;t even need to interact with it directly, it&#8217;s probably a good idea to know that an <code>uma-configuration</code> file looks like this:</p>
<p><pre class="brush: css; wrap-lines: false;">
{
    &quot;version&quot;: &quot;1.0&quot;,
    &quot;issuer&quot;: &quot;http://www.smartam.net&quot;,
    &quot;dynamic_client_registration_supported&quot;: &quot;yes&quot;,
    &quot;token_types_supported&quot;: [&quot;artifact&quot;],
    &quot;host_grant_types_supported&quot;: [
        &quot;authorization_code&quot;,
        &quot;client_credentials&quot;
     ],
    &quot;claim_types_supported&quot;: [&quot;openid&quot;],
    &quot;client_dynamic_registration_endpoint&quot;: &quot;http://www.smartam.net/api/oc/register&quot;,
    &quot;host_token_endpoint&quot;: &quot;http://www.smartam.net/oauth/token&quot;,
    &quot;host_user_endpoint&quot;: &quot;http://www.smartam.net/oauth/authorize&quot;,
    &quot;resource_set_registration_endpoint&quot;: &quot;http://www.smartam.net/api/uma/resource_reg&quot;,
    &quot;token_status_endpoint&quot;: &quot;http://www.smartam.net/api/uma/validation&quot;,
    &quot;permission_registration_endpoint&quot;: &quot;http://www.smartam.net/api/uma/permissions_reg&quot;,
    &quot;requester_token_endpoint&quot;: &quot;http://www.smartam.net/oauth/token&quot;,
    &quot;requester_user_endpoint&quot;: &quot;http://www.smartam.net/oauth/authorize&quot;,
    &quot;permission_request_endpoint&quot;: &quot;http://www.smartam.net/api/uma/permissions_grant/ticket&quot;
}
</pre></p>
<p>All you have to do with Puma is:</p>
<p><pre class="brush: python; wrap-lines: false;">
am = Puma.UMA.discover_am_endpoints(&quot;www.smartam.net&quot;)
</pre></p>
<p>What it does:</p>
<ul>
<ul>
<ul>
<li>reads the JSON resource found under <code>.well-known/uma-configuration</code></li>
<li>parses it, extracting endpoint info</li>
<li>stores the data deep below, in the storage layer, as an <code>AuthorizationManager</code> entity.</li>
<li>if the call is ever made with the same hostname that was just discovered, the call simply returns the existing AM data</li>
</ul>
</ul>
</ul>
<p>And you might want to keep that <code>am</code> object near. Because after discovery you&#8217;ll usually need&#8230;</p>
<h2>Registration</h2>
<p>To talk to the AM, the host needs to obtain an OAuth 2.0 token for use with the AMs endpoints. This is the PAT, or protection access token. We&#8217;ll need to go through a really standard OAuth flow to get it. For that, our applications need to be registered with the AM &#8211; in an OAuth sense; that means they need to have a <code>client_id</code> and <code>client_secret</code>.</p>
<p>Normally, the application is manually registered by the owner. Because it would be impossible to guarantee that every host and requester application out there would be registered with any AM they might be asked to work with (and the beauty of UMA is also in the freedom to choose an AM), AMs may support dynamic registration.</p>
<p>It&#8217;s pretty straightforward. Actually, one could argue that it&#8217;s easier than manual registration. So how do you register?</p>
<p><pre class="brush: python; wrap-lines: false;">
Puma.OAuth.oauth_registration(am, registration_data)
</pre></p>
<p>.. where <code>registration_data</code> is (let&#8217;s call it <code>rd</code> to make it short):</p>
<p><pre class="brush: python; wrap-lines: false;">
rd = Puma.Pouches.RegistrationData(
    client_name=&quot;Puma Host One&quot;,
    client_description=&quot;Puma Host One.&quot;,
    client_url=&quot;https://pumahostone.appspot.com&quot;,
    client_icon=&quot;https://pumahostone.appspot.com/static/images/resource_icon.png&quot;,
    redirect_url=&quot;https://pumahostone.appspot.com/callback&quot;
)
</pre></p>
<p>After this call, you&#8217;re all set. The application has been officially introduced to the AM.</p>
<p><a name="host-access-token"></a></p>
<h2>Getting a token</h2>
<p>To interact with the AM, the application has to get a token that represents the user of behalf of whom it is to communicate. This is a standard, nearly boring, OAuth 2.0 flow. The application should direct its user to a specially crafted authorization URL. The endpoint is:</p>
<blockquote><p><a href="http://www.smartam.net/oauth/authorize" rel="nofollow">http://www.smartam.net/oauth/authorize</a></p></blockquote>
<p>That&#8217;s not enough. A proper URL that will lead to an authorization dialog at the AM is more like the following:</p>
<blockquote><p><a href="http://www.smartam.net/oauth/authorize" rel="nofollow">http://www.smartam.net/oauth/authorize</a>?<br />
client_id=<em>host_client_id</em>&amp;<br />
redirect_uri=<em><a href="http://host.example.com/redirect" rel="nofollow">http://host.example.com/redirect</a></em>&amp;<br />
response_type=<em>code</em></p></blockquote>
<p>Puma will generate this for you without a problem. It takes a unique user identifier as an input, looks up the AM the user is set to use and constructs a proper authorization dialog URL. Handy:</p>
<p><pre class="brush: python; wrap-lines: false;">
authz_uri = Puma.OAuth.authz_uri_for_user(uma_user, redirect_uri)
</pre></p>
<p>You should redirect the user to this URI. When the user selects &#8220;allow&#8221; (or similar; hopefully anyway!) they will be redirected to your redirect URI. The handler for that URI should extract the <code>code</code> parameter and call:</p>
<p><pre class="brush: python; wrap-lines: false;">
Puma.UMA.trade_code_for_hat_and_store(code, redirect_uri)
</pre></p>
<p>&#8230; which will go through the rest of the OAuth 2.0 flow. That is, it will send the code to the appropriate endpoint over at the AM and receive a regular OAuth access token.</p>
<h2>Registering a resource</h2>
<p class="subtitle">When the hosting application wants to start protecting a resource, it first needs to register the resource with the AM. Registration is simple and intuitive &#8211; the resource registration endpoint is:</p>
<blockquote><p><a href="http://www.smartam.net/api/uma/resource_reg" rel="nofollow">http://www.smartam.net/api/uma/resource_reg</a></p></blockquote>
<p>This endpoint expects to find a resource set description in the request &#8211; this is a JSON object that should look like this:</p>
<p><pre class="brush: css; wrap-lines: false;">
{
    &quot;name&quot;: &quot;Photo Album&quot;,
    &quot;icon_uri&quot;: &quot;http://www.example.com/icons/flower.png&quot;,
    &quot;scopes&quot;: [
        &quot;http://photoz.example.com/dev/scopes/view&quot;,
        &quot;http://photoz.example.com/dev/scopes/all&quot;
    ]
}
</pre></p>
<p>The AM responds with an HTTP <code>201 Created</code> response akin to this:</p>
<p><pre class="brush: css; wrap-lines: false;">
HTTP/1.1 201 Created
Content-Type: application/uma-status+json
ETag: 126x358adkfgw3
...

{
&quot;status&quot;: &quot;created&quot;,
&quot;_id&quot;: (id of created resource set),
}
</pre></p>
<p>With Puma, you need to initialize and fill out an object that imitates the resource set description, <code>Pouches.Puma.ResourceSetDescription</code>:</p>
<p><pre class="brush: python; wrap-lines: false;">
description = Puma.Pouches.ResourceSetDescription()
description.scopes = [
    &quot;https://pumahostone.appspot.com/uma/scopes/read&quot;,
    &quot;https://pumahostone.appspot.com/uma/scopes/write&quot;
]
description.name = &quot;A name for the resource you're registering.&quot;
description.icon_uri = &quot;http://unsettling-icons.org/icons/resource.png&quot;
description._id = pre_generated_id

rx = Puma.UMA.register_resource(user_key, description)
[/pumacode]

Doing well. Now that the AM knows that it should be prepared for protecting such a resource (creating policies, handling token inquiries), all that needs to be done is tell the application itself that it should from now on...

[sourcecode language=&quot;python&quot; wraplines=&quot;false&quot;]
(continued)

rx = Puma.UMA.register_resource(user_key, description)
response_body = response.read()

# success!
if rx.status == 201:
    json_data = json.loads(response_body) # parse the JSON data into an object

# pull ETag from headers
etag = response.getheader('ETag')
# pull the policy uri from the JSON response
policy_uri = json_data['policy_uri']

# creating a ResourceMap
map = Puma.Util.create_resource_map(real_uri, pre_generated_id, etag, name, icon_uri, policy_uri, user_key)
</pre></p>
<h2>An insight into PumaHostOne: registering resources</h2>
<p>PumaHostOne uses a separate handler to handle resource registration.</p>
<p><a href="http://smartjisc.files.wordpress.com/2012/04/regres.png"><img src="http://smartjisc.files.wordpress.com/2012/04/regres.png?w=595" alt="" title="Resource registration"   class="aligncenter size-full wp-image-743" /></a></p>
<p>Available at <code>/uma/register-resource</code>, it handles any requests to register a resource. You will most likely want to copy this solution, if you decide to implement your own application.</p>
<p>A simplified (logging and some error checking has been stripped) version of the final handler is below, with comments (feel encouraged to check out the <a>real handler</a> as it contains some additional sanity checks that you might want to use as well!):</p>
<p><pre class="brush: python; wrap-lines: false;">
class RegisterResourceHandler(webapp.RequestHandler):
    @login_required
    def post(self):
      session = Session(self)
      current_user_key = session['key']

      user_key = current_user_key
# --- data from request (name, icon_uri, scopes?)
name = self.request.get('resource_name', None)
icon_uri = self.request.get('icon_uri', None)
scopes = self.request.get('scopes', None)
real_uri = self.request.get('uri', None)

# generate id (here, needed when constructing path)
pre_generated_id = Puma.Util.generate_resource_set_id(real_uri)

# devise a resource set description
description = Puma.Pouches.ResourceSetDescription()

# NOTE: hosting these scopes on AppEngine (be it static or dynamic) turned out to be unreliable
# .. bad luck, perhaps, but we kept getting timeouts. Hence the scopes moved to S3.
# Just a heads-up.

description.scopes = [
    &quot;http://smartcdn.s3.amazonaws.com/pumahost/dev_scopes/read.json&quot;,
    &quot;http://smartcdn.s3.amazonaws.com/pumahost/dev_scopes/write.json&quot;
]

description.name = name
description.icon_uri = &quot;http://cdn1.iconfinder.com/data/icons/Mobile-Icons/128/04_maps.png&quot;
description._id = pre_generated_id

rx = Puma.UMA.register_resource(user_key, description)
body = rx.read()

# success, create map
if rx.status == 201:

    json_data = json.loads(body)

    etag = rx.getheader('ETag') # pull ETag from headers
    policy_uri = json_data['policy_uri']

    Puma.Util.create_resource_map(real_uri, pre_generated_id, etag, name, icon_uri, policy_uri, user_key)

    session.set_flash(&quot;Resource registered.&quot;)
else:
    session.set_flash(&quot;Something went wrong.&quot;)

# redirect the user back to where he came from
self.redirect('/')
</pre></p>
<h2>An insight into PumaHostOne: smart-embedding &#8220;share&#8221;/&#8221;manage&#8221; buttons</h2>
<p>If you&#8217;re of the curious type, you&#8217;ve already seen <a href="https://pumahostone.appspot.com">PumaHostOne</a>. The buttons to the right of each resource are the subject of our little chat right now.</p>
<p>That&#8217;s actually an iframe. In order to allow nice separation of Puma &amp; application code, PumaHostOne has a separate handler that is meant to be used inside an iframe, and display either:</p>
<ul>
<ul>
<ul>
<li>a share! button, if the resource is not yet shared (insight: no <code>ResourceMap</code>)</li>
<li>settings &amp; stop sharing buttons, when the resource is being protected.</li>
</ul>
</ul>
</ul>
<p>How does it work?</p>
<ul>
<ul>
<ul class="more-spacing">
<ul class="more-spacing">
<li>the handler sits at <code>/internal/uma_mini_panel</code></li>
<li>input parameters are:
<ul>
<li><code>uri</code> &#8211; the URI of the resource; this is fundamental</li>
<li><code>name</code> &#8211; a name for the resource; this is auxiliary</li>
</ul>
</li>
<li>so for example, the iframe&#8217;s <code>src</code> could be:</li>
</ul>
</ul>
</ul>
</ul>
<blockquote><p>/internal/uma_mini_panel?<br />
uri=http://example.com/api/alice/address&amp;<br />
name=Alice&#8217;s%20Address</p></blockquote>
<ul>
<ul>
<ul class="more-spacing">
<li>on receiving such a request, the handler first checks to see if the resource identified by <code>uri</code> is protected (i.e. &#8211; again &#8211; no <code>ResourceMap</code> for this URI*)</li>
<li>if the resource is protected..
<ul>
<li>retrieves the policy URI for the resource and creates a settings button</li>
<li>retrieves the ID for the resource and glues together a working stop sharing</li>
</ul>
</li>
<li>if the resource is NOT protected..
<ul>
<li>creates a share!, which on click will send a request to <code>/uma/register-resource</code>, using the <code>name</code> parameter supplied.</li>
</ul>
</li>
</ul>
</ul>
</ul>
<p>Again, don&#8217;t be shy and take a peek at the source code. The handler you&#8217;re looking for is called <code>UMAMiniPanelHandler</code>. We&#8217;re not always that bad at coming up with names, promise.</p>
<h2>Checking token status</h2>
<p>Whenever an UMA requester makes a request, the requester&#8217;s access token is included inside a <code>WWW-Authenticate</code> header. Like this:</p>
<blockquote><p>WWW-Authenticate: Bearer 39mal1487ig819ree417ee389</p></blockquote>
<p>The host&#8217;s job, in order to determine if the requester is allowed to access the requested resource, is to pass that token to the token status endpoint at the AM &#8212; effectively asking &#8220;what can this token do?&#8221;. Upon receiving a token status description, the host can check if the required access (e.g. a DELETE)</p>
<p><em>While this step is done by the <code>Warden</code></em> &#8211; a piece of middleware that you can simply wrap your API handler in, here&#8217;s what the <code>Warden</code> calls under the hood:</p>
<p><pre class="brush: python; wrap-lines: false;">
token_status = Puma.UMA.check_token_status(am, hat, request_body)
</pre></p>
<p><code>token_status</code> is an <code>httplib.HTTPResponse</code> object. If you call <code>.read()</code> on it, you&#8217;ll have the response body in front of you. An example response looks like this:</p>
<p><pre class="brush: css; wrap-lines: false;">
[
   {
        &quot;resource_set_id&quot;: &quot;119n278b3600&quot;,
        &quot;scopes&quot;: [
            &quot;https://host.example.com/actions/read&quot;,
            &quot;https://host.example.com/actions/write&quot;
        ],
        &quot;exp&quot;: 1500819380
    },
    {
        &quot;resource_set_id&quot;: &quot;mn07689b5v74&quot;,
        &quot;scopes&quot;: [
            &quot;https://host.example.com/actions/read&quot;,
        ],
        &quot;exp&quot;: 1500814321
    }
]
</pre></p>
<p>For example (way too carefully detailed):</p>
<ul>
<ul>
<ol>
<li>a <code>GET</code> request for <code>/alice/personal/name</code> arrives at the host</li>
<li>host finds a requester token in <code>WWW-Authenticate</code></li>
<li>host looks up the AM that protects this resource</li>
<li>host asks AM about the status of the token</li>
<li>AM replies with response just like the one above</li>
<li>host translates <code>/alice/personal/name</code> to a resource id</li>
<li>turns out the id is <code>mn07689b5v74</code> &#8212; there are permissions associated with this resource for this token, good!</li>
<li>host translates <code>GET</code> to <code><a href="https://host.example.com/actions/read" rel="nofollow">https://host.example.com/actions/read</a></code> (the application must know how to translate actions on particular resources to actions/scopes. There&#8217;s no magic here, this is pretty much configured by the owner of the app.)</li>
<li>host finds that this token can read (<code>GET</code>) this resource (<code>mn07689b5v74</code>) &#8212; <code>actions</code> for this resource does contain the correct scope URI.</li>
<li>access is granted!</li>
</ol>
</ul>
</ul>
<p>So if the application finds that the the token has sufficient permissions associated with it, it may simply grant access, <em>and the story ends..</em></p>
<p>If it turns out that the RPT did not have enough permissions to access the requested resource, the host application goes to the AM and asks to register a sufficient permission with the token. The AM sends back a ticket, an opaque value, which is then sent back to the requester by the host. The token is ready to be upgraded.</p>
<p>Upon receiving a ticket (in the <code>WWW-Authenticate</code> header) from the host, the requester contacts the appropriate AM endpoint, passes the ticket, and receives a list of claims required in order to finish the upgrade (i.e. association of new permissions with the RPT).</p>
<p>All this business is swiftly handled by the <code>Warden</code>.</p>
<p>So at last, as a bonus:</p>
<h2>Understanding the warden</h2>
<p>One of the central parts of UMA is the decision process that happens at the host application whenever a resource is requested. Imagine a request for <tt><strong><a href="https://host-application.com/api/people/alice/personal/name" rel="nofollow">https://host-application.com/api/people/alice/personal/name</a></strong></tt>, a resource representing Alice&#8217;s personal name, is received by the HTTP server. The response is routed to the appropriate handler script that has to carefully analyze the request, and &#8211; in most non-trivial cases &#8211; consult the AM, inquiring about the validity of the token presented and any associated permissions.</p>
<p>The structure of <tt><a href="https://pumahostone.appspot.com/" rel="nofollow">PumaHostOne</a></tt> can be broken down into two main scripts:</p>
<ol>
<li><tt>main.py</tt><br />
the application logic, frontend, the tangible web application itself</li>
<li><tt>restapi-ng.py</tt><br />
handler for the RESTful API provided by the application</li>
</ol>
<p>Now, the server knows to route any requests for paths beginning with <tt><strong>"/api"</strong></tt> to <tt>restapi-ng.py</tt>, and everything else to <tt>main.py.</tt></p>
<p>However, when UMA comes into play, <em>someone</em> has to intercept every API-destined  request and give a verdict on what to do with it. The first, most basic decision is: <strong>is the resource UMA protected?</strong> Has the user chosen to restrict access to this resource with UMA? If the requested resource is protected, a *<tt>ResourceMap</tt>* object for the resource&#8217;s URI exists in the datastore. Take a look at this truly trivial <tt>if .. else</tt>, taken straight from the Warden&#8217;s code (note that the warden uses a pure WSGI interface to ease any eventual porting efforts):</p>
<p><pre class="brush: python; wrap-lines: false;">
path = environ['PATH_INFO']&lt;/pre&gt;
map = ResourceMap.gql(&quot;WHERE real_uri = :1&quot;, path.strip('/')).get() # (stripping for consistency)
if map:
# check if resource contains an access token
# speak UMA from now on.
else:
# resource is not protected, pass
# (this may be unclear to people ignorant of CGI/WSGI, read up?)
return self.app(environ, start_response)
</pre></p>
<p><strong>Case one:</strong> If no such object exists, the user hasn&#8217;t decided to use UMA for access management and the request is let through to the real API handler, which prepares a response based on its own logic and responds back to the requester. The warden interferes no more.</p>
<p><strong>Case two:</strong> If, however, a <tt><strong>ResourceMap</strong></tt> object is found, the warden has to act accordingly to the UMA protocol &#8211; check for an access token, ask the AM about the status of the token, respond to the requester with a UMA response and so on.</p>
<p>And for the chart-inclined:</p>
<p><a href="https://smartjisc.files.wordpress.com/2012/04/wardenexplained.png"><img class="aligncenter size-full wp-image-701" title="WardenExplained" src="https://smartjisc.files.wordpress.com/2012/04/wardenexplained.png?w=595" alt=""   /></a></p>
<p>It looks like we&#8217;re done here. Got questions? We&#8217;re here for you. <strong>Now go build awesome stuff!</strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smartjisc.wordpress.com/600/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smartjisc.wordpress.com/600/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=600&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smartjisc.wordpress.com/2012/04/20/puma-building-a-host-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/309687c012d0ca8df31597cfeec5ce35?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maligree</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2012/04/pumaanatomy.png" medium="image">
			<media:title type="html">Puma&#039;s anatomy</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2012/04/erd.png" medium="image">
			<media:title type="html">Host ERD</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2012/04/regres.png" medium="image">
			<media:title type="html">Resource registration</media:title>
		</media:content>

		<media:content url="https://smartjisc.files.wordpress.com/2012/04/wardenexplained.png" medium="image">
			<media:title type="html">WardenExplained</media:title>
		</media:content>
	</item>
		<item>
		<title>Releasing Puma.</title>
		<link>http://smartjisc.wordpress.com/2012/04/13/releasing-puma/</link>
		<comments>http://smartjisc.wordpress.com/2012/04/13/releasing-puma/#comments</comments>
		<pubDate>Fri, 13 Apr 2012 16:28:56 +0000</pubDate>
		<dc:creator>maligree</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://smartjisc.wordpress.com/?p=633</guid>
		<description><![CDATA[The time has come. We&#8217;re proud to announce that after serving us well internally and powering our sleek host and requester applications, it is time to release Puma &#8211; the little beast behind the curtain that you should definitely pay attention to &#8211; our Python library for swiftly implementing UMA enabled applications. Puma code repository: https://bitbucket.org/smartproject/puma-gae [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=633&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The time has come. We&#8217;re proud to announce that after serving us well internally and powering our sleek <a href="https://pumahostone.appspot.com" target="_blank">host</a> and <a href="https://pumarequesterone.appspot.com" target="_blank">requester</a> applications, it is time to release Puma &#8211; the little beast behind the curtain that you should definitely pay attention to &#8211; our Python library for swiftly implementing UMA enabled applications.</p>
<ul>
<li><strong>Puma</strong> code repository: <a href="https://bitbucket.org/smartproject/puma-gae" target="_blank">https://bitbucket.org/smartproject/puma-gae</a></li>
<li>Building a <strong>host application</strong> with Puma: <a href="https://smartjisc.wordpress.com/2012/04/20/puma-building-a-host-application/">right this way</a></li>
<li>Building a <strong>requester application</strong> with Puma: <a href="https://smartjisc.wordpress.com/2012/06/30/puma-building-a-requester-application/">over here</li>
</ul>
<p>As a reference implementation, don&#8217;t hesitate to check out both:</p>
<ul>
<li><strong>PumaHostOne</strong>: <a href="https://bitbucket.org/smartproject/pumahostone" target="_blank">https://bitbucket.org/smartproject/pumahostone</a></li>
<li><strong>PumaRequesterOne</strong>: <a href="https://bitbucket.org/smartproject/pumarequesterone" target="_blank">https://bitbucket.org/smartproject/pumarequesterone</a></li>
</ul>
<p>Learn more about the flow using <a href="http://www.smartam.net">SMARTAM</a> by viewing the following two presentations:</p>
<ul>
<li><a href="http://www.slideshare.net/smartjisc/smart-uma-alicetobob-sharing">http://www.slideshare.net/smartjisc/smart-uma-alicetobob-sharing</a></li>
<li><a href="http://www.slideshare.net/smartjisc/smart-uma-alicetoalice-sharing">http://www.slideshare.net/smartjisc/smart-uma-alicetoalice-sharing</a></li>
</ul>
<p>All code is released under the <a href="http://www.apache.org/licenses/LICENSE-2.0.html">Apache 2.0 license</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smartjisc.wordpress.com/633/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smartjisc.wordpress.com/633/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=633&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smartjisc.wordpress.com/2012/04/13/releasing-puma/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/309687c012d0ca8df31597cfeec5ce35?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maligree</media:title>
		</media:content>
	</item>
		<item>
		<title>The Business of Open Source</title>
		<link>http://smartjisc.wordpress.com/2011/12/19/the-business-of-open-source/</link>
		<comments>http://smartjisc.wordpress.com/2011/12/19/the-business-of-open-source/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 20:52:51 +0000</pubDate>
		<dc:creator>lukaszmoren</dc:creator>
				<category><![CDATA[Conferences]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[open source code]]></category>
		<category><![CDATA[open source projects]]></category>

		<guid isPermaLink="false">http://smartjisc.wordpress.com/?p=576</guid>
		<description><![CDATA[&#8220;I&#8217;ve experienced quite a bit about how open source works. It&#8217;s been a wonderful learning experience for me and definitely turned me from someone who thought open source code and developers were somehow not as good as closed source equivalents into a person who knows that the opposite is most definitely the case!&#8221;(Mark Little, Red [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=576&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<blockquote><p><span style="font-family:'Courier New', Courier, monospace;">&#8220;I&#8217;ve experienced quite a bit about how open source works. It&#8217;s been a wonderful learning experience for me and definitely turned me from someone who thought open source code and developers were somehow not as good as closed source equivalents into a person who knows that the opposite is most definitely the case!&#8221;(Mark Little, Red Hat, <a href="http://markclittle.blogspot.com/2011/06/open-source-in-action.html" target="_blank">blog</a>)</span></p></blockquote>
<p>Indisputable fact of today&#8217;s worlds is an existence of many IT companies that based their success on the Open Source. Talend, Alfresco, Cloudera, Mozilla and last but not least: Red Hat/JBoss (<a href="http://www.forentrepreneurs.com/lessons-from-leaders/jboss-example/">How JBoss did it!</a>) are great examples of that.</p>
<p><span id="more-576"></span></p>
<p>Many more, Google, Facebook, Microsoft and Yahoo and many more, provides commercial services, and are not entirely based on open source projects, but helps their communities, seeing obviously support business model in there. Growing popularity of cloud computing has been giving birth of new open source cloud platforms, high performance distributed computing, decentralized and scalable databases. Many of these solutions does not have comparable closed ones and all of them in some way constitute of the revenue for the enterprises.</p>
<p>Even though, many businesses are constantly striving for using closed source software provided by &#8220;big vendor&#8217;s&#8221;, with very expensive and professional marketing machine. Good, that there is slow, but visible movement towards open products build within communities. Benefits of that movement are getting more and more visible, followed by many successful stories. That is caused by many advantages of the Open Source.:</p>
<ul>
<li><strong>No vendor lock-in</strong></li>
</ul>
<div>
<p>There is no need to depend on any software vendor. Open source projects are free, and publicly available for everyone without requirement to sign purchase agreement. Take it and use it is the only rule. That gives high flexibility for any organization. If product does not suit your requirements you can simply change it without breaking contract and loosing money.</p>
<p>In more advanced cases you may want to have professional support for the open source product from external company that knows well this particular solution. Most of the times you can choose from at least few companies. Sometimes vendors provide a commercial version of open source projects. Using them make sense if you need very stable product, 24h support, SLA or customized functionality. Even if it looks like traditional vendor lock-in it is common practice that you require from them continuous compatibility with open source version, e.g. every feature requested by you that is added to commercial version is contributed back to the community. Then, you can always resign from their services and choose open source stack.</p>
</div>
<ul>
<li><strong><strong>Continuity</strong></strong></li>
</ul>
<div>
<p>If you purchase closed product you take the risk that vendor will not bankrupt or shutdown project while you use it. You may easily end up with &#8220;black box&#8221; product, not developed anymore with potential bugs and security issues that you cannot fix. Replacing solution with competitive one is not usually easy way either even if both are standard compliant. With Open Source you never come across that. In the blackest scenario you have source that you can modify, add new features, fix bugs or train developers to expand it further.</p>
</div>
<ul>
<li><strong><strong><strong>Companies competition</strong></strong></strong></li>
</ul>
<div>
<p>In most cases every mature open source products have several companies that provides professional services or commercial version of it. This provides to much healthier market than in single, monopoly vendor situation. Companies supporting clients has to compete with price, better adherence to the standards and services quality &#8211; often employees of these companies are commiters to open source projects and knows them very well.</p>
</div>
<ul>
<li><strong>Zero entry cost</strong></li>
</ul>
<div>
<p>It is always good practice to try out several solution, to choose most suitable one before deploying it within your organization. You can test several open source projects without any cost and choose one that best matches you requirements.</p>
</div>
<ul>
<li><strong>Reduced overall costs</strong></li>
</ul>
<div>
<p>From the business perspective what matters the most is TCO (Total Cost of Ownership) that determines direct and indirect costs of purchased software. There is plenty of arguments in Open Source favour:</p>
</div>
<ul>
<ul>
<li>Zero purchase fee.</li>
<li>No license fees, e.g. for every product user (does not increase cost when you organization grows)</li>
<li>No organizational administrative costs to purchase software, updates etc.</li>
<li>Competition in the markets keeps lower support costs and quality services</li>
<li>Eliminated risk of closing project by the vendor or vendor bankruptcy</li>
</ul>
</ul>
<ul>
<li><strong>Security and quality</strong></li>
</ul>
<div>
<p>Open source projects code is publicly available and may be seen by anyone. This causes that many developers from all over the world, browse actual source code, find bugs or security breaches and contribute patches. All they have different background, specialties, education so they focus on different aspects of the product. That makes overall open source software very reliable, consisting best practices of software engineering.</p>
</div>
<div>
<p>Open source software engineers produces much better code than in closed projects as code visible to their colleagues, random programmers or potential future employers.</p>
</div>
<ul>
<li><strong>Engineers are happy</strong></li>
</ul>
<div>That is what marketing and business people does not usually understand. Most of the engineers love to work for companies that has interesting and creative projects and uses &#8220;cool&#8221; technologies. Job then allows them not only to pay bills but as well fulfill their ambition, get chance to exhibit themselves in absorbing tasks and have satisfaction from what they are building. I&#8217;ve talked with few developers that were ready to agree to the lover salary in favor of working on more interesting projects.</div>
<div></div>
<div>Using and contributing to open source projects allows developers to interact with many different people from around the world, even if it is usually just through an email conversation. Developers may fix bugs add new features in whole community benefit. Their work is then visible for public and done in cooperation with other project members. Comparing to the internal team or particular customer. That makes them happy and encourages work. It&#8217;s completely not different from other technologist professions. The best enjoyment for an architect is to see that bridge he designed helps thousands of people, every day to move side to side.</div>
<ul>
<li><strong>Easier to add new features</strong></li>
</ul>
<div>Open Source gives you another benefit. Faster changes introduction comparing to the closed source software. It may take long time before your &#8220;big software vendor&#8221; gives you feature you requested. That depends how much money your organization pays for support and SLAs. Release proccess in community projects is much flexible and in the critical situations you can introduce change on your own.</div>
<ul>
<li><strong>Benefit from each other</strong></li>
</ul>
<div>If software is build by the community, many people and companies contributes to that. Not every functionality that your organization wants to use has to be implemented by your software vendor. In open source very often you get it for free, just because somebody else within the project community had similar problem to you. On the other hand, code contributed by your organization may be used by others. It&#8217;s a mutual benefit.</div>
<ul>
<li><strong>Have influence on a standard</strong></li>
</ul>
<p>Very often reference implementation of the standard specification is implemented as open source project. It allows all involved in the standard parties to work on the development to fulfill all theirs priorities. Even more often happens that implementation is done beforehand standardization. If your organization is one of its creators, you can influence the way that standard goes.</p>
<p>This article is a mix of our thoughts and discussions over last <a href="http://na11.apachecon.com/" target="_blank">ApacheCon NA 2011</a> in Vancouver, BC that SMART project was able to attend. Thanks very much for <a href="http://www.apache.org/travel/" target="_blank">TAC </a>team for the support.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smartjisc.wordpress.com/576/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smartjisc.wordpress.com/576/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=576&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smartjisc.wordpress.com/2011/12/19/the-business-of-open-source/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/9f838b2be387be46a9a072e8378d321c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">lukaszmoren</media:title>
		</media:content>
	</item>
		<item>
		<title>User eXperience &amp; Trusted Claims for UMA &#8211; New presentations!</title>
		<link>http://smartjisc.wordpress.com/2011/07/25/user-experience-trusted-claims-for-uma-new-presentations/</link>
		<comments>http://smartjisc.wordpress.com/2011/07/25/user-experience-trusted-claims-for-uma-new-presentations/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 15:21:13 +0000</pubDate>
		<dc:creator>Maciek</dc:creator>
				<category><![CDATA[Usability]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://smartjisc.wordpress.com/?p=549</guid>
		<description><![CDATA[Our colleague Domenico Catalano has just finished his stay at Newcastle University. During his stay Domenico has given two presentations &#8211; one on Exploring Visualization Techniques to Enhance Privacy Control UX for User-Managed Access and the other on Extending the UMA Protocol to support Trusted Claims. The first presentation is an attempt to enhance the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=549&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Our colleague Domenico Catalano has just finished his stay at Newcastle University. During his stay Domenico has given two presentations &#8211; one on<strong> Exploring Visualization Techniques to Enhance Privacy Control UX for User-Managed Access</strong> and the other on <strong>Extending the</strong> <strong>UMA Protocol to support Trusted Claims</strong>.</p>
<p><span id="more-549"></span> The first presentation is an attempt to enhance the graphical interface by use of visualizations in order to make the interface more self-explanatory and intuitive for the end-user.</p>
<div class="wp-caption aligncenter" style="width:590px;"><a href="http://www.slideshare.net/domcat/exploring-visualization-techniques-to-enhance-privacy-control-ux-for-usermanaged-access-8673854"><img title="Click to see presentation slides..." src="http://smartjisc.files.wordpress.com/2011/07/ux.png?w=580&#038;h=435" alt="" width="580" height="435" /></a></div>
<p><!--more-->The other presentation on Trusted Claims explains the concept of Claims-based Access Control and its role in UMA. The brief summary of his contribution can be seen here:</p>
<div class="wp-caption aligncenter" style="width:590px;"><a href="http://www.slideshare.net/domcat/uma-trusted-claims"><img title="Click to see presentation slides..." src="http://smartjisc.files.wordpress.com/2011/07/tclaims.png?w=580&#038;h=434" alt="" width="580" height="434" /></a></div>
<p>According to this approach the decision to grant access to a protected resource is made based on the requesting party information such as <em>name</em>, <em>age</em>, <em>email</em> <em>address</em>, <em>role</em>, <em>location</em> or <em>credit score</em>. In the presentation two user scenarios are shown: Enterprise class scenario and social/web class scenerio.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smartjisc.wordpress.com/549/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smartjisc.wordpress.com/549/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=549&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smartjisc.wordpress.com/2011/07/25/user-experience-trusted-claims-for-uma-new-presentations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/60cc8a6a362a2991692ccc3064f55ddf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">xpatsdotpl</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2011/07/ux.png?w=580" medium="image">
			<media:title type="html">Click to see presentation slides...</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2011/07/tclaims.png?w=580" medium="image">
			<media:title type="html">Click to see presentation slides...</media:title>
		</media:content>
	</item>
		<item>
		<title>OAuth 2.0 Implementation in Python</title>
		<link>http://smartjisc.wordpress.com/2011/07/23/oauth-2-0-implementation-in-python/</link>
		<comments>http://smartjisc.wordpress.com/2011/07/23/oauth-2-0-implementation-in-python/#comments</comments>
		<pubDate>Sat, 23 Jul 2011 21:44:39 +0000</pubDate>
		<dc:creator>maciejmachulak</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://smartjisc.wordpress.com/?p=561</guid>
		<description><![CDATA[The SMART team has just released a new OAuth 2.0 implementation in Python. You can find the source code here and the documentation for the library is available here. The library in Python has  been developed entirely by Jacek Szpot (with a little help from the SMART team). Jacek joined SMART around 4 weeks ago and we are very excited [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=561&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The SMART team has just released a new OAuth 2.0 implementation in Python. You can find the source code <a href="https://bitbucket.org/smartproject/oauth2python">here</a> and the documentation for the library is available <a href="https://bitbucket.org/smartproject/oauth2python/wiki/Home">here</a>. The library in Python has  been developed entirely by Jacek Szpot (with a little help from the SMART team). Jacek joined SMART around 4 weeks ago and we are very excited about this first release.</p>
<p>The OAuth 2.0 Python library has been released under the Apache 2.0 license and we plan to continue further development. As always, we very much appreciate feedback and we&#8217;re open to suggestions on how to make the library better!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smartjisc.wordpress.com/561/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smartjisc.wordpress.com/561/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=561&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smartjisc.wordpress.com/2011/07/23/oauth-2-0-implementation-in-python/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/8cd0a485adb87d2df8543cc6966c943c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maciejmachulak</media:title>
		</media:content>
	</item>
		<item>
		<title>SMART Mobile &#8211; Coming Soon!</title>
		<link>http://smartjisc.wordpress.com/2011/07/22/smart-mobile/</link>
		<comments>http://smartjisc.wordpress.com/2011/07/22/smart-mobile/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 10:31:14 +0000</pubDate>
		<dc:creator>Maciek</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://smartjisc.wordpress.com/?p=464</guid>
		<description><![CDATA[Very soon, we are planning to release a mobile version of the SMART Authorization Manager, called SMART Mobile. This application has been designed to work with Android devices (&#62; 1.5) but it will work on iPhone and other smartphones too. Each app user needs to register at www.smartam.net and generate the API KEY using the provided [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=464&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Very soon, we are planning to release a mobile version of the SMART Authorization Manager, called SMART Mobile. This application has been designed to work with Android devices (&gt; 1.5) but it will work on iPhone and other smartphones too. Each app user needs to register at <a href="http://www.smartam.net">www.smartam.net</a> and generate the API KEY using the provided API. This API KEY has to be then copied to the settings form of SMART Mobile. This applications allows the user to view a log of access history and access requests on his or her smartphone. This way as an owner of protected resources, you can always track and have more control of your data on the Web.</p>
<div class="wp-caption aligncenter" style="width:580px;"><a href="http://smartjisc.files.wordpress.com/2011/06/2_home.png"><img style="float:left;" title="smartam. mobile" src="http://smartjisc.files.wordpress.com/2011/06/2_home.png?w=135" alt="" width="135" /></a><a href="http://smartjisc.files.wordpress.com/2011/06/1_settings.png"><img style="float:left;" title="smartam. mobile" src="http://smartjisc.files.wordpress.com/2011/06/1_settings.png?w=135" alt="" width="135" /></a><a href="http://smartjisc.files.wordpress.com/2011/06/4_history.png"><img style="float:left;" title="smartam. mobile" src="http://smartjisc.files.wordpress.com/2011/06/4_history.png?w=135" alt="" width="135" /></a><a href="http://smartjisc.files.wordpress.com/2011/06/5_event.png"><img style="float:left;" title="smartam. mobile" src="http://smartjisc.files.wordpress.com/2011/06/5_event.png?w=135" alt="" width="135" /></a></div>
<p>To obtain an API KEY you need to log into your account at <a href="http://www.smartam.net">www.smartam.net</a>. Go to an account page, and generate your API KEY.</p>
<div class="wp-caption aligncenter" style="width:580px;"><a href="http://smartjisc.files.wordpress.com/2011/06/api1.png"><img title="smartam. mobile" src="http://smartjisc.files.wordpress.com/2011/06/api1.png?w=570" alt="" width="570" /></a></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smartjisc.wordpress.com/464/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smartjisc.wordpress.com/464/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=464&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smartjisc.wordpress.com/2011/07/22/smart-mobile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/60cc8a6a362a2991692ccc3064f55ddf?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">xpatsdotpl</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2011/06/2_home.png?w=135" medium="image">
			<media:title type="html">smartam. mobile</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2011/06/1_settings.png?w=135" medium="image">
			<media:title type="html">smartam. mobile</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2011/06/4_history.png?w=135" medium="image">
			<media:title type="html">smartam. mobile</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2011/06/5_event.png?w=135" medium="image">
			<media:title type="html">smartam. mobile</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2011/06/api1.png?w=570" medium="image">
			<media:title type="html">smartam. mobile</media:title>
		</media:content>
	</item>
		<item>
		<title>Domenico &amp; Jacek join SMART</title>
		<link>http://smartjisc.wordpress.com/2011/06/30/domenico-jacek-join-smart/</link>
		<comments>http://smartjisc.wordpress.com/2011/06/30/domenico-jacek-join-smart/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 14:55:34 +0000</pubDate>
		<dc:creator>maciejmachulak</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://smartjisc.wordpress.com/?p=529</guid>
		<description><![CDATA[We are extremely happy to announce that the SMART Team has 2 new members – Domenico Catalano (Oracle Corp., Italy) and Jacek Szpot (Wroclaw University of Technology, Poland). Domenico’s theoretical knowledge and real-world experience in the areas of security, usability and software development will help with addressing issues and concerns raised in the initial UX study of SMARTAM. Jacek, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=529&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>We are extremely happy to announce that the SMART Team has <strong>2</strong> new members – <strong>Domenico Catalano</strong> (Oracle Corp., Italy) and <strong>Jacek Szpot </strong>(Wroclaw University of Technology, Poland). Domenico’s theoretical knowledge and real-world experience in the areas of security, usability and software development will help with addressing issues and concerns raised in the initial UX study of SMARTAM. Jacek, on the other hand, is gaining experience in the areas of software development and Web security and will help with progressing with development of the UMA/j framework. Stay tuned for more exciting news!</p>
<div class="mceTemp mceIEcenter">
<dl class="wp-caption aligncenter">
<dt class="wp-caption-dt"><a href="http://smartjisc.files.wordpress.com/2011/06/smart_team.jpeg"><img class="size-full wp-image-530 " title="smart_team" src="http://smartjisc.files.wordpress.com/2011/06/smart_team.jpeg?w=595" alt=""   /></a></dt>
<dd class="wp-caption-dd"></dd>
</dl>
</div>
<p style="text-align:center;">
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smartjisc.wordpress.com/529/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smartjisc.wordpress.com/529/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=529&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smartjisc.wordpress.com/2011/06/30/domenico-jacek-join-smart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/8cd0a485adb87d2df8543cc6966c943c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maciejmachulak</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2011/06/smart_team.jpeg" medium="image">
			<media:title type="html">smart_team</media:title>
		</media:content>
	</item>
		<item>
		<title>SMARTAM with History log and Access Requests log</title>
		<link>http://smartjisc.wordpress.com/2011/06/30/smartam-with-history-log-and-access-requests-log/</link>
		<comments>http://smartjisc.wordpress.com/2011/06/30/smartam-with-history-log-and-access-requests-log/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 11:05:36 +0000</pubDate>
		<dc:creator>maciejmachulak</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[UX]]></category>

		<guid isPermaLink="false">http://smartjisc.wordpress.com/?p=503</guid>
		<description><![CDATA[We have just launched a new release of SMARTAM at www.smartam.net. Apart from fixing a few bugs, this release comes with two brand new features: History log Access requests log History log is a list enabling you to see who accessed your resources and when. This way you are given even more control over protection of your [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=503&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>We have just launched a new release of <strong>SMARTAM </strong>at <a href="http://www.smartam.net">www.smartam.net</a>. Apart from fixing a few bugs, this release comes with two brand new features:</p>
<ul>
<li><strong>History log</strong></li>
<li><strong>Access requests log</strong></li>
</ul>
<p><strong>History log</strong> is a list enabling you to see who accessed your resources and when. This way you are given even more control over protection of your resources and you are always able to follow what happens to your data. The other feature -<strong> Access requests</strong> &#8211; is a list of notifications from your friends who have heard about your data (e.g. newly uploaded photos) and have sent you a request to be able to access this data. You can then easily grant access to the requested data (according to your preferences!) instantly as this feature is located in the sidebar on almost all the pages of SMARTAM. This way you will be always sure that you didn&#8217;t missed anybody while setting security and privacy settings for your resources! Read more to see example screenshots!</p>
<p><span id="more-503"></span></p>

<a href='http://smartjisc.wordpress.com/2011/06/30/smartam-with-history-log-and-access-requests-log/wall3/' title='wall3'><img data-liked='0' data-reblogged='0' data-attachment-id="519" data-orig-file="http://smartjisc.files.wordpress.com/2011/06/wall3.jpg" data-orig-size="811,354" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="wall3" data-image-description="" data-medium-file="http://smartjisc.files.wordpress.com/2011/06/wall3.jpg?w=300" data-large-file="http://smartjisc.files.wordpress.com/2011/06/wall3.jpg?w=595" width="150" height="65" src="http://smartjisc.files.wordpress.com/2011/06/wall3.jpg?w=150&#038;h=65" class="attachment-thumbnail" alt="wall3" /></a>
<a href='http://smartjisc.wordpress.com/2011/06/30/smartam-with-history-log-and-access-requests-log/wall2/' title='wall2'><img data-liked='0' data-reblogged='0' data-attachment-id="518" data-orig-file="http://smartjisc.files.wordpress.com/2011/06/wall21.jpg" data-orig-size="1315,1062" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="wall2" data-image-description="" data-medium-file="http://smartjisc.files.wordpress.com/2011/06/wall21.jpg?w=300" data-large-file="http://smartjisc.files.wordpress.com/2011/06/wall21.jpg?w=595" width="150" height="121" src="http://smartjisc.files.wordpress.com/2011/06/wall21.jpg?w=150&#038;h=121" class="attachment-thumbnail" alt="wall2" /></a>
<a href='http://smartjisc.wordpress.com/2011/06/30/smartam-with-history-log-and-access-requests-log/smartam-contacts-secure-data-sharing-on-the-web_13083155848431/' title='smartam-contacts-secure-data-sharing-on-the-web_13083155848431'><img data-liked='0' data-reblogged='0' data-attachment-id="505" data-orig-file="http://smartjisc.files.wordpress.com/2011/06/smartam-contacts-secure-data-sharing-on-the-web_130831558484311.png" data-orig-size="943,696" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="smartam-contacts-secure-data-sharing-on-the-web_13083155848431" data-image-description="" data-medium-file="http://smartjisc.files.wordpress.com/2011/06/smartam-contacts-secure-data-sharing-on-the-web_130831558484311.png?w=300" data-large-file="http://smartjisc.files.wordpress.com/2011/06/smartam-contacts-secure-data-sharing-on-the-web_130831558484311.png?w=595" width="150" height="110" src="http://smartjisc.files.wordpress.com/2011/06/smartam-contacts-secure-data-sharing-on-the-web_130831558484311.png?w=150&#038;h=110" class="attachment-thumbnail" alt="smartam-contacts-secure-data-sharing-on-the-web_13083155848431" /></a>
<a href='http://smartjisc.wordpress.com/2011/06/30/smartam-with-history-log-and-access-requests-log/access_requests/' title='access_requests'><img data-liked='0' data-reblogged='0' data-attachment-id="508" data-orig-file="http://smartjisc.files.wordpress.com/2011/06/access_requests.png" data-orig-size="753,398" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="access_requests" data-image-description="" data-medium-file="http://smartjisc.files.wordpress.com/2011/06/access_requests.png?w=300" data-large-file="http://smartjisc.files.wordpress.com/2011/06/access_requests.png?w=595" width="150" height="79" src="http://smartjisc.files.wordpress.com/2011/06/access_requests.png?w=150&#038;h=79" class="attachment-thumbnail" alt="access_requests" /></a>

<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/smartjisc.wordpress.com/503/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/smartjisc.wordpress.com/503/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=smartjisc.wordpress.com&#038;blog=11510055&#038;post=503&#038;subd=smartjisc&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://smartjisc.wordpress.com/2011/06/30/smartam-with-history-log-and-access-requests-log/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/8cd0a485adb87d2df8543cc6966c943c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">maciejmachulak</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2011/06/wall3.jpg?w=150" medium="image">
			<media:title type="html">wall3</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2011/06/wall21.jpg?w=150" medium="image">
			<media:title type="html">wall2</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2011/06/smartam-contacts-secure-data-sharing-on-the-web_130831558484311.png?w=150" medium="image">
			<media:title type="html">smartam-contacts-secure-data-sharing-on-the-web_13083155848431</media:title>
		</media:content>

		<media:content url="http://smartjisc.files.wordpress.com/2011/06/access_requests.png?w=150" medium="image">
			<media:title type="html">access_requests</media:title>
		</media:content>
	</item>
	</channel>
</rss>
