<div dir="ltr">You can tell based on the openid.mode parameter, which identifies the message type. Since each message is specifically either a direct or an indirect message, you can tell that way.</div><div class="gmail_extra">
<br clear="all"><div>--<br>Andrew Arnott<br>"I [may] not agree with what you have to say, but I'll defend to the death your right to say it." - S. G. Tallentyre</div>
<br><br><div class="gmail_quote">On Mon, Jun 24, 2013 at 6:18 AM, Michał Górny <span dir="ltr"><<a href="mailto:mgorny@gentoo.org" target="_blank">mgorny@gentoo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello,<br>
<br>
I'm implementing an OpenID provider server and looking throughout the<br>
OpenID Auth 2.0 spec, I can't find how to properly distinguish a direct<br>
request from an indirect one.<br>
<br>
What I'm trying to do is properly implement error responses. As far as<br>
I understand the spec, there are three kinds of error responses I need<br>
to support:<br>
<br>
* error responses to direct requests that need to be sent KV-encoded,<br>
<br>
* error responses to indirect requests that should be sent back<br>
to openid.return_to as a redirect,<br>
<br>
* error responses to malformed indirect requests (esp. lacking<br>
openid.return_to) that should be displayed human-readable to user.<br>
<br>
As far as I can guess, a request having openid.return_to is most likely<br>
an indirect request. But how to distinguish a direct request from a<br>
malformed indirect request?<br>
<br>
The spec is mostly putting overlapping rules on direct and indirect<br>
requests. It also lists the uses for particular kinds of requests but<br>
that doesn't seem normative, and doesn't solve malformed request<br>
problem.<br>
<br>
The only other heuristic I can think of is using the Accept header,<br>
assuming that a web browser would list any kind of HTML format there<br>
and OpenID client wouldn't.<br>
<br>
Could any of you help me? I've tried on <a href="http://stackoverflow.com" target="_blank">stackoverflow.com</a> already [1]<br>
and didn't get a single answer. Feel free to answer there if you'd like<br>
to get the kudos.<br>
<br>
[1]:<a href="http://stackoverflow.com/questions/17217502/how-to-distinguish-server-side-direct-request-from-an-indirect-request-in-open" target="_blank">http://stackoverflow.com/questions/17217502/how-to-distinguish-server-side-direct-request-from-an-indirect-request-in-open</a><br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Best regards,<br>
Michał Górny<br>
</font></span><br>_______________________________________________<br>
Code mailing list<br>
<a href="mailto:Code@lists.openid.net">Code@lists.openid.net</a><br>
<a href="http://lists.openid.net/mailman/listinfo/openid-code" target="_blank">http://lists.openid.net/mailman/listinfo/openid-code</a><br>
<br></blockquote></div><br></div>