Note that there are some explanatory texts on larger screens.

plurals
  1. POOpenID - Generating Signature
    primarykey
    data
    text
    <p>I've been writing my own implementation of Open ID RP (yes I know there are plenty already built, I'm doing it for "fun"). Everything works fine until I am in the verification step and calculate the hash and compare it against the sig I got from the OP in the positive assertion.</p> <p>I've read the spec up and down but there are a few things that weren't clear to me:</p> <ol> <li><p>Do I only include the key value pairs in the openid namespace or everything that's in the list in openid.signed? <a href="http://openid.net/specs/openid-authentication-2_0.html#generating_signatures" rel="nofollow">6.1</a> makes it sound like I should only use openid. keys even though I have some other stuff hanging out in openid.signed (ax).</p></li> <li><p>Should the last key value pair be follow by a line break?</p></li> <li><p>I'm assuming the values should be url encoded (as not to have colons in the value). If so, I would also assume the hex values, such as %3D, should be uppercase. I ran into that on an OAuth 1.0 implementation, since .NET's built in URL encoding uses lower case hex letters.</p></li> </ol> <p>I'm fairly certain the encoding and algorithm are fine but my base string is off. Here is a completely unaltered version of an example which I can't get to work:</p> <p>Querystring I get back from the OP with the positive assertion: <code>openid.ns=http://specs.openid.net/auth/2.0&amp;openid.mode=id_res&amp;openid.op_endpoint=https://www.google.com/accounts/o8/ud&amp;openid.response_nonce=2011-05-13T08:18:42ZBHyiLFGyNT-SqQ&amp;openid.return_to=http://mysite.com/Account/Login.aspx&amp;openid.assoc_handle=AOQobUc4P9MWC3faGcMkfTb2U10KfGQ-6cm9L4pLDQmeoY2DE6XRGtN0&amp;openid.signed=op_endpoint,claimed_id,identity,return_to,response_nonce,assoc_handle,ns.ext1,ext1.mode,ext1.type.firstname,ext1.value.firstname,ext1.type.email,ext1.value.email,ext1.type.lastname,ext1.value.lastname&amp;openid.sig=KSXw+bv7sLlQyUIflA3Jzx5VoPk=&amp;openid.identity=https://www.google.com/accounts/o8/id?id=AItOawkDYxJln6LwTAdl0kP8xdMT71SoRufUFA4&amp;openid.claimed_id=https://www.google.com/accounts/o8/id?id=AItOawkDYxJln6LwTAdl0kP8xdMT71SoRufUFA4&amp;openid.ns.ext1=http://openid.net/srv/ax/1.0&amp;openid.ext1.mode=fetch_response&amp;openid.ext1.type.firstname=http://axschema.org/namePerson/first&amp;openid.ext1.value.firstname=firstname&amp;openid.ext1.type.email=http://schema.openid.net/contact/email&amp;openid.ext1.value.email=testingopenid5132011@gmail.com&amp;openid.ext1.type.lastname=http://axschema.org/namePerson/last&amp;openid.ext1.value.lastname=lastname</code></p> <p>The base string I built using that querystring: <code>op_endpoint:https://www.google.com/accounts/o8/ud\nclaimed_id:https://www.google.com/accounts/o8/id?id=AItOawkDYxJln6LwTAdl0kP8xdMT71SoRufUFA4\nidentity:https://www.google.com/accounts/o8/id?id=AItOawkDYxJln6LwTAdl0kP8xdMT71SoRufUFA4\nreturn_to:http://mysite.com/Account/Login.aspx\nresponse_nonce:2011-05-13T08:18:42ZBHyiLFGyNT-SqQ\nassoc_handle:AOQobUc4P9MWC3faGcMkfTb2U10KfGQ-6cm9L4pLDQmeoY2DE6XRGtN0\nns.ext1:http://openid.net/srv/ax/1.0\next1.mode:fetch_response\next1.type.firstname:http://axschema.org/namePerson/first\next1.value.firstname:firstname\next1.type.email:http://schema.openid.net/contact/email\next1.value.email:testingopenid5132011@gmail.com\next1.type.lastname:http://axschema.org/namePerson/last\next1.value.lastname:lastname\n</code></p> <p>The mac key as returned by the assocation request: <code>U/1wUBAU2aYIR+2eIsugXyEOpmE=</code></p> <p>Using all of this with HMAC-SHA1, the hash I get is: <code>9HMRL4je44Oz90s1f8pw5qpZ8HQ=</code></p> <p>But as you can see from openid.sig, it should be <code>KSXw+bv7sLlQyUIflA3Jzx5VoPk=</code></p> <p>Am I formulating the base string incorrectly? Am I calculating the hash wrong? How is something this "simple" taking so long to implement correctly?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload