Top Level Namespace

Defined Under Namespace

Modules: MojeIDAttributes Classes: MojeID

Instance Method Summary collapse

Instance Method Details

#xrds_meta(request) ⇒ Object

Helper method that generate meta tag for xrds authentification



3
4
5
# File 'lib/xrds_helpers.rb', line 3

def xrds_meta(request)
  "<meta http-equiv=\"x-xrds-location\" content=\"#{request.protocol}#{request.host_with_port}/xrds\" />"
end

#xrds_response(return_url) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/xrds_helpers.rb', line 7

def xrds_response(return_url)
  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<xrds:XRDS xmlns:xrds=\"xri://$xrds\" xmlns=\"xri://$xrd*($v*2.0)\">
  <XRD>
    <Service>
      <Type>http://specs.openid.net/auth/2.0/return_to</Type>
      <URI>#{return_url}</URI>
    </Service>
  </XRD>
</xrds:XRDS>"
end