ruby on rails - How to check if nonce has been used? -


in rails 3.1.5 application, using ims-lti gem perform third-party authentication. perform authentication, 3 things must done:

  1. check request signature correct
  2. check if timestamp old
  3. check nonce has not been used

the first 2 done, having trouble nonce check. questions have found deal generating nonces in rails, not checking them.

there several related questions use oauth-plugin gem check nonce:

rails oauth-plugin: multiple strategies causes duplicate nonce error

oauth signature verification fails

return false unless oauthnonce.remember(nonce, timestamp) 

unfortunately, oauth-plugin gem hasn't been updated since 2013, , not compatible version of oauth gem required lms-lti gem.

it not appear oauth gem supports validating nonces.

is there canned way check nonce, whether in native rails or through gem, or relegated to:

  • creating nonce table
  • checking nonce not in table
  • storing nonce , timestamp in table
  • cycling table drop entries expired timestamp


Comments

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -