views:

30

answers:

1

My website's root page automatically redirects all users to some subpage via http header.

http://example.com/ → http://example.com/subpage

I want to use my domain example.com as OpenID. The problem is that I have to add some tag to my root page, but it should redirect all users on subpage. I can change the type of redirection and use e.g. meta tag. But is there a better way to implement that and don't break instant http redirect?

Maybe I can somehow distinguish OpenID request and only that time respond with html?

+2  A: 

You can specify the location of a Yadis document (which could be a static file in public/) by setting the X-XRDS-Location header, or you can choose to handle the application/xrds+xml MIME type at your application root dynamically.

  • See the Yadis wikipedia page for an overview of what the Yadis document is and what you need to return in your XRDS document.
  • There's a rubyonrails.org blog post on how to handle a custom MIME type. It looks like this is still how it works in Rails 3 (you don't need a custom renderer).
wuputah
I've added `XRDS` responder, that you can see at http://sema.in with `Accept: application/xrds+xml` header (I checked with htty gem), but I can't log in with this openid on any website. E.g. StackOverflow answers "No OpenID endpoint found."
Semyon Perepelitsa