annotate framework/env/auth/openid/xrds_document.lua @ 20:47ddf0f86009
OpenID 2.0 Relying Party support
 | author | 
 jbe/bsw | 
 | date | 
 Fri Apr 02 02:11:32 2010 +0200 (2010-04-02) | 
 | parents | 
  | 
 | children | 
 3a6fe8663b26  | 
 
 | rev | 
   line source | 
| 
jbe/bsw@20
 | 
     1 --[[--
 | 
| 
jbe/bsw@20
 | 
     2 auth.openid.xrds_document{
 | 
| 
jbe/bsw@20
 | 
     3   return_to_module = return_to_module,
 | 
| 
jbe/bsw@20
 | 
     4   return_to_view   = return_to_view
 | 
| 
jbe/bsw@20
 | 
     5 }
 | 
| 
jbe/bsw@20
 | 
     6 
 | 
| 
jbe/bsw@20
 | 
     7 This function returns an XRDS document with Content-Type
 | 
| 
jbe/bsw@20
 | 
     8 application/xrds+xml. For more information see documentation on
 | 
| 
jbe/bsw@20
 | 
     9 auth.openid.xrds_document{...}.
 | 
| 
jbe/bsw@20
 | 
    10 
 | 
| 
jbe/bsw@20
 | 
    11 --]]--
 | 
| 
jbe/bsw@20
 | 
    12 
 | 
| 
jbe/bsw@20
 | 
    13 function auth.openid.xrds_document(args)
 | 
| 
jbe/bsw@20
 | 
    14   slot.set_layout(nil, "application/xrds+xml")
 | 
| 
jbe/bsw@20
 | 
    15   slot.put_into("data",
 | 
| 
jbe/bsw@20
 | 
    16     "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
 | 
| 
jbe/bsw@20
 | 
    17     "<xrds:XRDS xmlns:xrds=\"xri://$xrds\" xmlns=\"xri://$xrd*($v*2.0)\">\n",
 | 
| 
jbe/bsw@20
 | 
    18     "  <XRD>\n",
 | 
| 
jbe/bsw@20
 | 
    19     "    <Service>\n",                                                   
 | 
| 
jbe/bsw@20
 | 
    20     "      <Type>http://specs.openid.net/auth/2.0/return_to</Type>\n",
 | 
| 
jbe/bsw@20
 | 
    21     "      <URI>",
 | 
| 
jbe/bsw@20
 | 
    22     encode.url{
 | 
| 
jbe/bsw@20
 | 
    23       base   = request.get_absolute_baseurl(),
 | 
| 
jbe/bsw@20
 | 
    24       module = args.return_to_module,
 | 
| 
jbe/bsw@20
 | 
    25       view   = args.return_to_view
 | 
| 
jbe/bsw@20
 | 
    26     },
 | 
| 
jbe/bsw@20
 | 
    27     "</URI>\n",
 | 
| 
jbe/bsw@20
 | 
    28     "    </Service>\n",
 | 
| 
jbe/bsw@20
 | 
    29     "  </XRD>\n",
 | 
| 
jbe/bsw@20
 | 
    30     "</xrds:XRDS>\n"
 | 
| 
jbe/bsw@20
 | 
    31   )
 | 
| 
jbe/bsw@20
 | 
    32 end
 |