<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Breno is probably going to give a better answer.   </div><div><br></div><div>The client is communicating via post message to the JS hosted at the IDP.  </div><div>In that call the JS origin of the caller is available. </div><div><br></div><div>John B <br><br>Sent from my iPhone</div><div><br>On Jan 14, 2014, at 12:05 PM, Todd W Lainhart <<a href="mailto:lainhart@us.ibm.com">lainhart@us.ibm.com</a>> wrote:<br><br></div><blockquote type="cite"><div><font size="2" face="sans-serif">Section 4.2 of the Session Mgmt. spec talks
about how the OP iframe calculates the session_state to be compared to
that given previously to the RP in the auth code flow.  That section
says this:</font>
<br>
<br><font size="2" face="Verdana">"The OP iframe MUST recalculate it
from the previously obtained Client ID, the source origin URL (from the
postMessage), and the current OP Browser state. If the received value and
the calculated value do not match, then the OP iframe MUST postMessage
the string </font><font size="2" color="#002060" face="Courier New">changed</font><font size="2" face="Verdana"> back
to the source. If it matched, then it MUST postMessage the string </font><font size="2" color="#002060" face="Courier New">unchanged</font><font size="2" face="Verdana">.</font><font size="3">
"</font>
<br>
<br><font size="2" face="sans-serif">...which implies that the OP will have
to calculate that value at the authorization endpoint.</font>
<br>
<br><font size="2" face="sans-serif">If I'm understanding this, I'm not getting
how the OP can reliably know what the source origin URL is at the time
the session_state is provisioned and given to the RP.</font>
<br>
<br><font size="2" face="sans-serif">Am I missing something?  I've included
the example from Section 4.2 of the Session Mgmt. spec below.</font>
<br>
<br><font size="2" face="sans-serif">   -- Todd</font>
<br>
<br>
<br>
<br><font size="2" face="Courier New"> window.addEventListener("message",
receiveMessage, false);<br>
<br>
  function receiveMessage(e){ // e has client_id and session_state<br>
<br>
    // Validate message origin<br>
    client_id = message.split(' ')[0];<br>
    session_state = message.split(' ')[1];<br>
    var salt = session_state.split('.')[1];<br>
<br>
    // get_op_browser_state() is an OP defined function<br>
    // that returns the browser's login status at the OP.<br>
    // How it is done is entirely up to the OP.<br>
    var opbs = get_op_browser_state();<br>
<br>
    // Here, the session_state is calculated in this particular
way,<br>
    // but it is entirely up to the OP how to do it under the<br>
    // requirements defined in this specification.<br>
    var ss = CryptoJS.SHA256(client_id + ' ' + e.origin + ' '
+<br>
      opbs + [' ' + salt]) [+ "." + salt];<br>
<br>
    if (e.session_state == ss) {<br>
      stat = 'unchanged';<br>
    } else {<br>
      stat = 'changed';<br>
    }<br>
<br>
    e.source.postMessage(stat, e.origin);<br>
  };</font>
<br>
<br><font size="2" face="sans-serif"><br>
</font>
<br>
<table width="223" style="border-collapse:collapse;">
<tbody><tr height="8">
<td width="223" bgcolor="white" style="border-style:solid;border-color:#000000;border-width:0px 0px 0px 0px;padding:0px 0px;"><font size="1" face="Verdana"><b><br>
<br>
<br>
Todd Lainhart<br>
Rational software<br>
IBM Corporation<br>
550 King Street, Littleton, MA 01460-1250</b></font><font size="1" face="Arial"><b><br>
1-978-899-4705<br>
2-276-4705 (T/L)<br>
<a href="mailto:lainhart@us.ibm.com">lainhart@us.ibm.com</a></b></font></td></tr></tbody></table>
<br></div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>Openid-specs-ab mailing list</span><br><span><a href="mailto:Openid-specs-ab@lists.openid.net">Openid-specs-ab@lists.openid.net</a></span><br><span><a href="http://lists.openid.net/mailman/listinfo/openid-specs-ab">http://lists.openid.net/mailman/listinfo/openid-specs-ab</a></span><br></div></blockquote></body></html>