I think (I have not tested this myself) that the problem is that federated_identification is not encoded. Try replacing the question mark with %3F . Also make sure the URL
https://google.com/accounts/o8/site-xrds?hd=example.com
work.
The test I did was go to the url
http://testsk2012.appspot.com/_ah/login_redir?claimid=https://www.google.com/accounts/o8/site-xrds%3Fhd=somesite.com&continue=http://testsk2012.appspot.com/
and it succeeded.
source share