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:
- check request signature correct
- check if timestamp old
- 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
Post a Comment